Skip to content
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

aiohttp: variable routes are tagged with different paths #8

Closed
lazitski-aliaksei opened this issue Nov 1, 2019 · 0 comments
Closed
Labels
bug Something isn't working

Comments

@lazitski-aliaksei
Copy link

If app uses variable route, requests with this urls are tagged with full path, which varies between requests.

For example:

...
app.add_route('/some/resource/{some_id}/child', handler)
...

Requests to this route are send to dogstatsd with full path, i.e.:

http_request_duration{method="GET",path="/some/resource/36d12223-1454-461c-9ed5-6d6777d98e80/child" ,",status="200",quantile="0.5"} 0.007255767000060587

It could be more convenient if such requests are reported with path pattern, i.e.:

http_request_duration{method="GET",path="/some/resource/{some_id}/child" ,",status="200",quantile="0.5"} 0.007255767000060587

Quick research shows that this info can be retrieved from request.match_info.route.resource.canonical, but this looks suspiciously long construction to be reliable. ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants