-
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
Resource attribute "service.instance.id" is converted to label "instance", conflicting with auto-generated prometheus label #32484
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. |
@Aneurysm9 Hi! Could you give your opinion on this? Thanks in advance |
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 is intentional and comes from here: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#resource-attributes In prometheus, it is expected that job and instance are identifying for a series. We rely on that to ensure joins with the target_info metric work properly. If you are scraping the prometheus exporter, I would encourage you to set honor_labels=true when doing so to preserve the original service.name and service.instance.id to prevent collisions of this sort. |
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. |
Component(s)
exporter/prometheus
What happened?
Description
I'm not sure if this is intended or not, but when a metric is sent with the resource attribute "service.instance.id", the prometheus exporter creates a label named "instance" for the metric.
This label will conflict with the auto-generated instance label:
This becomes a problem when we have multiple otel collectors for high availability, because we can end in a scenario where metrics from 2 different otel collector instances end up "merged" in a single timeseries.
Steps to Reproduce
1-Create a simple metric with service.instance.id resource attribute:
metrics.json:
2-Send the metric to the otel collector:
curl -X POST -H "Content-Type: application/json" -d @metrics.json -i localhost:4318/v1/metrics
Expected Result
What I would propose is that the label created would be named "service_instance_id" instead of "instance"
Actual Result
A label named "instance" is created:
curl localhost:9130/metrics
Collector version
otelcol-contrib version 0.97.0
Environment information
No response
OpenTelemetry Collector configuration
Log output
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: