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

Extend headerLabels Support to All Prometheus Metrics #10774

Open
2 tasks done
leonlyu1996 opened this issue May 31, 2024 · 1 comment · May be fixed by #10783
Open
2 tasks done

Extend headerLabels Support to All Prometheus Metrics #10774

leonlyu1996 opened this issue May 31, 2024 · 1 comment · May be fixed by #10783
Labels
area/middleware/metrics contributor/wanted Participation from an external contributor is highly requested kind/enhancement a new or improved feature. priority/P3 maybe status/2-needs-review

Comments

@leonlyu1996
Copy link

leonlyu1996 commented May 31, 2024

Welcome!

  • Yes, I've searched similar issues on GitHub and didn't find any.
  • Yes, I've searched similar issues on the Traefik community forum and didn't find any.

What did you expect to see?

Currently, headerLabels allows add extra labels to Prometheus metrics. However, this functionality is limited to the requests_total metric. I propose extending this capability to other Prometheus metrics, like request_duration and more.

This enhancement would be very helpful in many use cases. For instance, we can use request_duration metric with header label X-Country-Code to analyze response times by countries.

I understand that supporting it could potentially lead to high cardinality issues. However, this risk can be mitigated by advising users to configure headerLabels judiciously.

I am happy to contribute the code for the feature if this request is accepted.

@mmatur mmatur self-assigned this Jun 3, 2024
@mmatur mmatur added kind/enhancement a new or improved feature. status/2-needs-review area/middleware/metrics priority/P3 maybe contributor/wanted Participation from an external contributor is highly requested and removed status/0-needs-triage labels Jun 3, 2024
@mmatur
Copy link
Member

mmatur commented Jun 3, 2024

Hi @leonlyu1996,

Thanks for your proposal.

I can totally see the benefit of this enhancement and yes the cardinality can be very high, we have to add an explicit note in the documentation to explain that.

Feel free to start a PR

@mmatur mmatur removed their assignment Jun 3, 2024
@leonlyu1996 leonlyu1996 linked a pull request Jun 5, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/middleware/metrics contributor/wanted Participation from an external contributor is highly requested kind/enhancement a new or improved feature. priority/P3 maybe status/2-needs-review
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants