Reputation: 1
I have success and failure metrics as follows:
A.B.p1.success
A.B.p3.success
A.B.p4.success
...
A.B.p1.failure
A.B.p2.failure
A.B.p4.failure
...
I have in total ~30 persons, and I want to show the each person's success rate as calculated by:
alias(asPercent(A.B.p1.success,sumSeries(A.B.p1.success,A.B.p1.failure)), 'p1')
The problem I have:
1) If I hard-code all the persons in each row, it exceeds the max row Grafana allowed, andd I want to plot them on the same graph
2) If there a way I can do it by a Grafana function?
Thanks in advance!
Upvotes: 0
Views: 25534
Reputation: 7979
The way to do this in Graphite is to use a subquery:
Use the sumSeriesWithWildcard function to sum multiple series to get the total in #A:
https://stackoverflow.com/a/12837800/22688
For more, on the AsPercent function read my blog post on this. I describe how to use the AsPercent function at the end:
If the asPercent function does not work (depends on which version and variant of Graphite you are using), you can achieve the same result with mapSeries and reduceSeries (also in the blog post):
aliasByNode(reduceSeries(mapSeries(groupByNodes(snap.gceprod.*.intel.docker.kube-system.*.snap.stats.filesystem.*.{usage,capacity}, 'maxSeries', 2, 11), 0), 'asPercent', 1, 'usage', 'capacity'), 0)
I answered a similar question here if you need another example: https://stackoverflow.com/a/42714756/22688
Upvotes: 4