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

Option to add custom field from request #15

Open
gitmalong opened this issue Mar 28, 2023 · 1 comment
Open

Option to add custom field from request #15

gitmalong opened this issue Mar 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@gitmalong
Copy link

gitmalong commented Mar 28, 2023

Hi!

Given the scenario that I would like to get metrics for requests from a certain basic auth identified user I would need to be able to extract such a field and add it as custom label to the metrics next to labels: endpoint, method, status.

Could that be supported somehow?

Thanks

@Ptrskay3
Copy link
Owner

Ptrskay3 commented Mar 29, 2023

I'm afraid that it's currently not possible to extend labels, however I might try to implement it someday. It doesn't seem to be easy that's for sure. If you'd like to customize labels, I'd suggest writing your own middleware, similar to Axum's Prometheus example.

@Ptrskay3 Ptrskay3 added the enhancement New feature or request label Mar 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants