Collect metrics about request duration with App.Metrics and Prometheus

I need to collect correlating metrics of Request duration and Amount of returning items.
We use App.Metrics library. And the best way I currently found is use regular Gauge for each one.
The problem is that using Gauge we can loose changes occurred between Prometheus scrapings.

Does anyone have better idea than Gauge usage?
Thanks in advance.

I tried to tag each request metrics with unique Correlation Id, but Grafana treats each of them as separated metric and displays as separated graph.
I also tried to use App.Metrics.Histogram, which judging by description could solve the problem, but in practice it reports only Sum, Count and quantiles.

Here the what the Histogram reports It doesn’t contains all occurrences. Only Sum, Count and quantiles

  • Histogram is the correct approach, if I understand what you want. Can you clarify what is you problem with it?

    – 

  • @markalex Thanks for your response. The problem is that Histogram reports only Sum , Count and quantiles. Not all changes occurred between scraps

    – 




Leave a Comment