Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphite WildCard Percentage Calculation

I am working on a graph which has servers in our infrastructure, each server has a metric1 and metric2, I need metric1 / metric2

My Grafana dashboard graph has

Row A : DC_Servers.*.Metric1
Row B: DC_Servers.*.Metric2

At this point I see all three servers and metric1 and metric2. How do I get the percentage, i.e. metric1 / metric2 on the same graph, given I have to use wild card to include all servers in DC?

like image 781
Nik Avatar asked Oct 24 '25 14:10

Nik


1 Answers

This should give you Metric1 & of Metric2 for every series (so will generate % series for the number of servers you have)

   reduceSeries(mapSeries(DC_Servers.*.{Metric1,Metric2},1),"asPercent",2,"Metric1","Metric2")

The functions reduceSeries and mapSeries are new in Graphite 1.0.0.

like image 103
Torkel Avatar answered Oct 27 '25 08:10

Torkel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!