Skip to content

equivalence

Dieter Plaetinck edited this page Jan 31, 2014 · 2 revisions

example

for example diamond provides metrics like cpu.<core number>.<type> where <core number> can be 'total' (sum of all cores). collectd only provides the individuals

we need to be able to see total cpu usage from both plugins, whether or not you (only) have the per-core metrics and/or the totals, preferring only the total if available.

this is achieved by having the total metric setting core=_sum_ and summing by core. for every tag being summed by, the algorithm checks if there's one that has value <tag>=_sum_ and if so uses that (only) and removes the other ones.

more precisely:

for all sum_by tag keys, if you only use the '' bucket, and don't filter on the tag, if there's a metric that has <tag>=_sum_ it will be used to represent the sum; and metrics that are otherwise equal except for this one tag, will be removed.

the other way around: if we are summing, and we have a filter, and we have individual ones and a sum, remove the sum. irrespective of buckets. note that this removes the sum target without the user needing to filter it out explicitly this is the only place we filter out metrics without the user explicitly filtering them out.

notes:

not yet supported for avg_by. not tested with multiple aggregation keys.

Clone this wiki locally