I've got fairly specific use case where I need to multiply:
- metric A by metric B, let's call it AB
- metric C by metric D, let's call it CD and so on
Then I need to use AB
, CD
... YZ
together in order to work out result, let's call it ABYZ
. The real transformations are more complicated, but let's skip it as it's not that important.
It would make my life easier if I have the AB
and CD
precalculated, as I could query it using template variables in Grafana.
Let's say I could specify variable $include
which would be list of pairs: AB
, CD
etc.
Then I could easily control the results for ABYZ
by including some of the metrics and excluding some of them.
In my current schema, without metrics being precalculated, it's not possible to use template variables, as at this stage is not possible to work out which metric should by multiplied by which metric.
Let's say I would like to get the results of this Graphite query: alias(diffSeries(maxSeries(multiplySeries(maxSeries(stats.gauges.stock.{stock1,stock2}.offers.EUR.bid.), averageSeries(stats.gauges.stock.currency.fidor..EUR.PLN)),maxSeries(stats.gauges.stock.{stock1,stock2}.offers.PLN.bid.*)), minSeries(multiplySeries(minSeries(stats.gauges.stock.{stock1,stock2}.offers.EUR.ask.), averageSeries(stats.gauges.stock.currency.fidor..EUR.PLN)),minSeries(stats.gauges.stock.{stock1,stock2}.offers.PLN.ask.*))), 'diff')
and store it in this metrics: stats.gauges.stock.diff
Is there any solution which could create new metrics from existing ones? I would like skip StatsD layer and touch the graphite
/ carbon
layer directly (if possible).