-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract HTTP Path Pattern in Metrics #461
Labels
enhancement
New feature or request
Comments
Ah, I assume that the middleware just "takes" the The test gets the Can you somehow add it nested to all routes without adding it manually to all leaf routes? |
kolloch
pushed a commit
to kolloch/poem
that referenced
this issue
Dec 21, 2022
kolloch
pushed a commit
to kolloch/poem
that referenced
this issue
Dec 21, 2022
...so metrics correctly report the innermost PathPattern. poem-web#461
kolloch
pushed a commit
to kolloch/poem
that referenced
this issue
Dec 21, 2022
...so metrics correctly report the innermost PathPattern. poem-web#461
kolloch
pushed a commit
to kolloch/poem
that referenced
this issue
Dec 21, 2022
...that tests whether the middleware sees the innermost PathPattern in the response. poem-web#461
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the feature
For the request metrics, I see two labels that roughly do what I want:
http.url
andhttp.path_pattern
.http.url
is to specific and includes the concrete URL including IDs "resolved" in the pattern. I cannot use it, since it will increase the cardinality of the metric drastically (and therefore increase our bills too much). Basically, a separate time series is stored for all label combinations in most metric systems that I know.The
http.path_pattern
sounds like what I want but only includes the route prefix at the point where I mounted the middleware, not of the nested route.The corresponding watched/subscriber routes are mounting like this:
I'd love
/private/nx-release/control/badges/subscriber/:subscription_id
as thehttp_pattern
(or another label).Existing Code
This is were the
http.path_pattern
is added.https://github.com/poem-web/poem/blob/master/poem/src/middleware/opentelemetry_metrics.rs#L82-L85
PathPattern
is a simple string container:It is set here:
poem/poem/src/route/router.rs
Lines 319 to 328 in 4692e5b
Weirdly, there is test code that pretty much asserts the behavior that I want:
poem/poem/src/route/router.rs
Lines 499 to 563 in 4692e5b
I wonder what goes wrong in my case?
The text was updated successfully, but these errors were encountered: