Grafana dividing 2 series

前端 未结 2 564
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-20 00:32

I\'m trying to divide 2 series to get their ratio. For example I\'m got sites (a.com, b.com, c.com) as * (All sites) Each of them has total sections count and errors occurre

相关标签:
2条回答
  • 2021-01-20 00:52

    A new function divideSeriesLists was introduced in Graphite 1.0.2 for dividing one series with another. Both the series should be of same length.

    0 讨论(0)
  • 2021-01-20 00:59

    You can use mapSeries with divideSeries to do vector matching of series in Graphite (or maybe asPercent depending on which version of graphite you are using).

    An example query:

    aliasByNode(reduceSeries(mapSeries(groupByNodes(parser.*.{sections,errors}.total, 'maxSeries', 1, 2), 0), 'asPercent', 1, 'sections', 'errors'), 0)

    I'm not sure what aggregation function you are using so substitute maxSeries for the function you need.

    Check out this blog post about using mapSeries with divideSeries for more explanation.

    Here is an example from our system in the Grafana query editor:

    0 讨论(0)
提交回复
热议问题