[service] Remove duplicated service labels on every datapoint in prometheus output#14811
Conversation
… metrics Resource attributes (service_name, service_instance_id, service_version) were stamped as constant labels on every internal metric datapoint via WithResourceConstantLabels for OpenCensus backwards compatibility (added in open-telemetry#9029). These attributes are already carried by target_info, so the duplication inflates cardinality and causes label name inconsistencies when the Prometheus translation strategy changes (as seen in #47011). Remove WithResourceConstantLabels from the default config so resource attributes appear only in target_info, following the correct Prometheus and OTel data model convention. Assisted-by: Claude Opus 4.6
Merging this PR will not alter performance
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #14811 +/- ##
==========================================
- Coverage 91.39% 91.37% -0.03%
==========================================
Files 695 695
Lines 44403 44405 +2
==========================================
- Hits 40584 40576 -8
- Misses 2686 2692 +6
- Partials 1133 1137 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Yang Song <[email protected]>
…ocessortest to v0.149.0 (#49) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [go.opentelemetry.io/collector/processor/processortest](https://github.com/open-telemetry/opentelemetry-collector) | `v0.148.0` → `v0.149.0` |  |  | --- ### Release Notes <details> <summary>open-telemetry/opentelemetry-collector (go.opentelemetry.io/collector/processor/processortest)</summary> ### [`v0.149.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1550v01490) [Compare Source](open-telemetry/opentelemetry-collector@v0.148.0...v0.149.0) ##### 🛑 Breaking changes 🛑 - `pkg/service`: Remove `service_name`, `service_instance_id`, and `service_version` as constant labels on every internal metric datapoint. These attributes are already present in `target_info` and were being duplicated on each series for OpenCensus backwards compatibility. ([#​14811](open-telemetry/opentelemetry-collector#14811)) Previously, the collector stamped every internal metric series (e.g. `otelcol_process_runtime_heap_alloc_bytes`) with `service_name`, `service_instance_id`, and `service_version` labels to match the old OpenCensus behavior. These attributes are now only present in the `target_info` metric, which is the correct Prometheus/OTel convention. Users who filter or group by these labels on individual metrics will need to update their queries to use `target_info` joins instead. ##### 💡 Enhancements 💡 - `all`: Move aix/ppc64 to tier 3 support ([#​13380](open-telemetry/opentelemetry-collector#13380)) - `all`: Upgrade the profiles stability status to alpha ([#​14817](open-telemetry/opentelemetry-collector#14817)) The following components have their profiles status upgraded from development to alpha: - pdata/pprofile - connector/forward - exporter/debug - receiver/nop - exporter/nop - exporter/otlp\_grpc - exporter/otlp\_http - `cmd/mdatagen`: Add semconv reference for attributes ([#​13297](open-telemetry/opentelemetry-collector#13297)) ##### 🧰 Bug fixes 🧰 - `cmd/mdatagen`: Fix entity code generation so `extra_attributes` are emitted as resource attributes instead of entity descriptive attributes. ([#​14778](open-telemetry/opentelemetry-collector#14778)) <!-- previous-version --> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://gitea.t000-n.de/t.behrendt/tracebasedlogsampler/pulls/49 Reviewed-by: t.behrendt <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
…1.55.0 (#44) This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [go.opentelemetry.io/collector/confmap](https://github.com/open-telemetry/opentelemetry-collector) | `v1.54.0` → `v1.55.0` |  |  | --- ### Release Notes <details> <summary>open-telemetry/opentelemetry-collector (go.opentelemetry.io/collector/confmap)</summary> ### [`v1.55.0`](https://github.com/open-telemetry/opentelemetry-collector/blob/HEAD/CHANGELOG.md#v1550v01490) ##### 🛑 Breaking changes 🛑 - `pkg/service`: Remove `service_name`, `service_instance_id`, and `service_version` as constant labels on every internal metric datapoint. These attributes are already present in `target_info` and were being duplicated on each series for OpenCensus backwards compatibility. ([#​14811](open-telemetry/opentelemetry-collector#14811)) Previously, the collector stamped every internal metric series (e.g. `otelcol_process_runtime_heap_alloc_bytes`) with `service_name`, `service_instance_id`, and `service_version` labels to match the old OpenCensus behavior. These attributes are now only present in the `target_info` metric, which is the correct Prometheus/OTel convention. Users who filter or group by these labels on individual metrics will need to update their queries to use `target_info` joins instead. ##### 💡 Enhancements 💡 - `all`: Move aix/ppc64 to tier 3 support ([#​13380](open-telemetry/opentelemetry-collector#13380)) - `all`: Upgrade the profiles stability status to alpha ([#​14817](open-telemetry/opentelemetry-collector#14817)) The following components have their profiles status upgraded from development to alpha: - pdata/pprofile - connector/forward - exporter/debug - receiver/nop - exporter/nop - exporter/otlp\_grpc - exporter/otlp\_http - `cmd/mdatagen`: Add semconv reference for attributes ([#​13297](open-telemetry/opentelemetry-collector#13297)) ##### 🧰 Bug fixes 🧰 - `cmd/mdatagen`: Fix entity code generation so `extra_attributes` are emitted as resource attributes instead of entity descriptive attributes. ([#​14778](open-telemetry/opentelemetry-collector#14778)) <!-- previous-version --> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My41LjQiLCJ1cGRhdGVkSW5WZXIiOiI0My41LjQiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Reviewed-on: https://gitea.t000-n.de/t.behrendt/tracebasedlogsampler/pulls/44 Reviewed-by: t.behrendt <[email protected]> Co-authored-by: Renovate Bot <[email protected]> Co-committed-by: Renovate Bot <[email protected]>
…etheus output (open-telemetry#14811) Partially resolves open-telemetry#14814 (removes duplicated attributes) Internal collector metrics exposed with Prometheus by default have duplicated service labels (`service_name`, `service_instance_id`, `service_version`) on every datapoint while the same service attributes emitted as `target_info` labels ending up as proper resource attributes which the metrics scraped with Prometheus receiver (`service.name`, `service.instance.id`, `service. version`) The duplicated labels on every internal metric datapoint were added for OpenCensus backwards compatibility in open-telemetry#9029 long time ago. Given that now the `target_info` is correctly translated to Resource attributes and the duplication leads to open-telemetry/opentelemetry-collector-contrib#47011, it should be good time to remove it. --------- Co-authored-by: Yang Song <[email protected]>
Partially resolves #14814 (removes duplicated attributes)
Internal collector metrics exposed with Prometheus by default have duplicated service labels (
service_name,service_instance_id,service_version) on every datapoint while the same service attributes emitted astarget_infolabels ending up as proper resource attributes which the metrics scraped with Prometheus receiver (service.name,service.instance.id,service. version)The duplicated labels on every internal metric datapoint were added for OpenCensus backwards compatibility in #9029 long time ago. Given that now the
target_infois correctly translated to Resource attributes and the duplication leads to open-telemetry/opentelemetry-collector-contrib#47011, it should be good time to remove it.