Extend headerLabels
Support to All Prometheus Metrics
#10774
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
Welcome!
What did you expect to see?
Currently,
headerLabels
allows add extra labels to Prometheus metrics. However, this functionality is limited to therequests_total
metric. I propose extending this capability to other Prometheus metrics, likerequest_duration
and more.This enhancement would be very helpful in many use cases. For instance, we can use
request_duration
metric with header labelX-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.
The text was updated successfully, but these errors were encountered: