prometheus-net-contrib icon indicating copy to clipboard operation
prometheus-net-contrib copied to clipboard

Add more ASP.NET metrics

Open mfkl opened this issue 4 years ago • 3 comments

This PR adds aspnetcore_requests_total as well as aspnetcore_requests_current_total metrics.

/cc @gr-liam

mfkl avatar Jul 01 '21 07:07 mfkl

I think you forgot to increase the metrics, and we might not need the counteraspnetcore_requests_total because we already have this infoaspnetcore_requests_duration_seconds_count. But the concurrent connections gauge is very handy :)

faustodavid avatar Jul 08 '21 09:07 faustodavid

I think you forgot to increase the metrics

Thanks, added the missing inc/dec. Not too sure how to test this properly though..

and we might not need the counter aspnetcore_requests_total because we already have this info aspnetcore_requests_duration_seconds_count

Are you saying that Histogram.Count would be equivalent to a Total Requests counter?

mfkl avatar Jul 15 '21 07:07 mfkl

Thanks, added the missing inc/dec. Not too sure how to test this properly though..

Yeah, testing might be challenging right now, maybe adding black-box testing or introducing interfaces, but these are major changes. I am waiting for @alexvaluyskiy to listen to his plan.

Are you saying that Histogram.Count would be equivalent to a Total Requests counter?

Yes, if you measure the latency of every request then you are also measuring the number of requests.

You can try this.

sum(rate(aspnetcore_requests_duration_seconds_count{namespace="$namespace", service="$service", code=~"[2-3]..", pod=~"$pod"}[$interval])) by (service, namespace, route, method, code)

faustodavid avatar Jul 15 '21 19:07 faustodavid