You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having trouble with Prometheus generating a new label for each request in one part of an application, but others are correctly mapped, e.g. /posts/:post_id/ instead of /posts/12345. I noticed that there is a strip_ids_from_path method and a PATH_INFO env var that seem to allow this to be tuned per application, but no documentation on how this would work. How can i use these options to collapse all the /posts/12345 type labels into /posts:post_id?
The text was updated successfully, but these errors were encountered:
The collector middleware we provide in Prometheus::Middleware::Collector is intended to cater to basic HTTP metric collection needs and doesn't allow customising path filtering or metric labels.
Back when we were preparing for our 1.0 release, we did consider adding some extra options to initialize, to allow customising labels and path handling by passing lambdas to it which would override our default implementations. We quickly realised that once we did that, there was essentially nothing left of our middleware code and it was just invoking lambdas. At that point, we didn't feel that there was any value in using our middleware and it would be better for users of client_ruby to create their own collector middleware in their application's codebase (possibly copying ours as a base).
If you're interested, the original discussion is over at #111 and references the implementation that we scrapped.
I'm having trouble with Prometheus generating a new label for each request in one part of an application, but others are correctly mapped, e.g.
/posts/:post_id/
instead of/posts/12345
. I noticed that there is astrip_ids_from_path
method and aPATH_INFO
env var that seem to allow this to be tuned per application, but no documentation on how this would work. How can i use these options to collapse all the/posts/12345
type labels into/posts:post_id
?The text was updated successfully, but these errors were encountered: