Grafana dividing 2 series

前端 未结 2 563
爱一瞬间的悲伤
爱一瞬间的悲伤 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: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:

提交回复
热议问题