flask_prometheus_metrics icon indicating copy to clipboard operation
flask_prometheus_metrics copied to clipboard

Variable routes recording variable values in metrics

Open sorend opened this issue 1 year ago • 0 comments

Hi:

I was trying to setup flask_prometheus_metrics, but it seems that the library uses variable values instead of the static route definitions in the metrics.

E.g. @app.route("/print/<value>")

I would have expected the metrics app_request_latency_seconds to look like: app_request_latency_seconds_count{endpoint="/print/<value>",method="GET"} 10.0

But in reality I have 10 that looks like this: app_request_latency_seconds_count{endpoint="/print/2aae6c35c94fcfb415dbe95f408b9ce91ee846ed",method="GET"} 1.0

Is this intentional?

(as you can see in the example, by using actual values over the static route definition, the application quickly generates a lot of metrics)

BR, Soren

sorend avatar Aug 09 '23 06:08 sorend