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

URL Templates in metrics plugin #106

Closed
serpi90 opened this issue Jul 3, 2020 · 1 comment · Fixed by #107
Closed

URL Templates in metrics plugin #106

serpi90 opened this issue Jul 3, 2020 · 1 comment · Fixed by #107
Assignees
Milestone

Comments

@serpi90
Copy link
Member

serpi90 commented Jul 3, 2020

A new metric with the URL template, not the fully resolved URL would be nice.

It's almost impossible to aggregate them later (it needs to be done case by case which is not maintainable in the long term).

Currently, you get metrics for:
http://example.com/pets/1/favourite-foods/3
http://example.com/pets/1/favourite-foods/2
http://example.com/pets/4/favourite-foods/3
http://example.com/pets/7/favourite-foods?type=fish
I think it would be better if we can provide something like this:
/pets/<pet-uuid>/favourite-foods/<food-uuid>
/pets/<pet-uuid>/favourite-foods

Ideally, it would be a label on top of the current metrics:

http_request_count{url="http://example.com/pets/741/metrics",...,url_template="/pets/741"} 1 1593204634530

But if not possible, a new metric with template_url instead of URL would also be useful.

@gcotelli gcotelli self-assigned this Jul 3, 2020
@gcotelli gcotelli added this to the v5.1 milestone Jul 3, 2020
@gcotelli
Copy link
Member

gcotelli commented Jul 6, 2020

I've implemented it, but by now it only works if you set the logging level at least to 2. I've opened svenvc/zinc#55 : if it gets implemented then this can also work for logging level at 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants