stefanprodan / podinfo

Go microservice template for Kubernetes

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More labels for http_requests_total

jkremser opened this issue · comments

Currently the metric called http_requests_total has only one label called status.
Adding the same labels as defined for the histogram metric called http_request_duration_seconds_bucket would be nice.
Namely:

  • method
  • path

I think it can be obtained from the http_request_duration_seconds_count but it's not straightforward.

I've created simple PR #186, that addresses these missing tags.

What's the issue with http_request_duration_seconds_count? Adding those tags to http_requests_total would just duplicate the existing metrics

I don't think there any issue with http_request_duration_seconds_count, but http_requests_total is missing the path and methods tags.

I personally use those tags (specially status & path) on http_requests_total to measure error rate, so when I saw this issue I thought of adding them.

Here is how you can use http_request_duration_seconds_count to measure the error rate: https://github.com/fluxcd/flagger/blob/main/pkg/metrics/observers/http.go

ohh, I see. Nice tip! Thanks 🙏

I suppose we can close that PR, since it's definitively not necessary to measure error rate

Going to close this since http_request_duration_seconds_count is a counter just like http_requests_total.