-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[exporter/prometheus] Allow setting custom "job" and "instance" attributes #33118
Comments
Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping Pinging code owners:
See Adding Labels via Comments if you do not have permissions to add labels yourself. |
This issue has been closed as inactive because it has been stale for 120 days with no activity. |
Component(s)
exporter/prometheus
What happened?
Description
prometheusexporter
automatically sets thejob
andinstance
attributes on metrics exposed for scraping, which are derived from the metric's resource attributes.If you try setting custom
job
/instance
values then the conversion to prometheus metric data model fails because of duplicate labels:Steps to Reproduce
Submit a metric to this component with either of these attributes set. Then call its
/metrics
endpointExpected Result
Custom label values take priority over the default values
Actual Result
Setting custom label values breaks scraping for these metrics
Collector version
v0.100.0
Environment information
Reproduced locally but this should be reproducible on all environments
OpenTelemetry Collector configuration
Log output
Additional context
Our use case is migrating some metrics to OpenTelemetry collector, so we want to preserve the existing
job
values to avoid breaking existing dashboards/alertsI've patched this in our custom fork by checking if job/instance are already set before setting the default
The text was updated successfully, but these errors were encountered: