简体   繁体   中英

Librato > Composite Metrics: Subtract two meters

I have two different meters reporting values:

Meter A: Items looked up against data store Meter B: Items returned from data store

I want my chart to also have a composite metric that just tracks the difference between these two values for easy observation. However, I'm struggling getting Librato to report this value properly.

What I have at this point is based on the subtract example here: http://support.metrics.librato.com/knowledgebase/articles/354670-composite-metrics-language-tutorial

However, the results it reports are a scale factor off of the real number. It seems the number it reports is the actual number divided by some number, which may be the number of separate sources reporting the value.

For instance Metric A = 100 items Metrics B = 50 items Composite = 25 items ?? (seems to be off by factor of 2)

The factor changes depending on the specific datapoint.

Rich,

Without seeing the actual data streams I'm just taking a guess, but there are a couple of possibilities:

  • Picking a summary function: If the metric is reporting multiple client-side aggregated samples, it may be reporting as a complex gauge with individual components of: count, sum, min, max, etc. To view the total number of items in the metric you would want to choose the sum property. You can do this by setting "function":sum as an option to the series function.

  • Aligning data points in time: The subtract function works by subtracting points aligned in time. If the two metrics are reporting at different time steps there may be points where they don't align. You can fix this by setting a measure_time when POSTing the samples to the API or by setting the period option of the series function to the period of the data.

Always feel free to copy us at support@librato.com on any questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM