Skip to content

Prometheus receiver uses Deprecated attributes from old semconv version #32814

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

Closed
robincw opened this issue May 2, 2024 · 4 comments · Fixed by #32829 or #39803
Closed

Prometheus receiver uses Deprecated attributes from old semconv version #32814

robincw opened this issue May 2, 2024 · 4 comments · Fixed by #32829 or #39803
Assignees
Labels
enhancement New feature or request receiver/prometheus Prometheus receiver

Comments

@robincw
Copy link

robincw commented May 2, 2024

Component(s)

receiver/prometheus

Is your feature request related to a problem? Please describe.

The Prometheus receiver uses semconv/v1.6.1 since 2 years ago
to add resource attributes to convert from the Prometheus to the OpenMetrics convention when scraping
but these are confusing in meaning and deprecated according to latest documentation.

In addition, there are many dependencies (alerts, dashboards, recording rules) in the world which depend on the job and instance labels in metrics but the receiver is dropping these without any option to keep them.

Describe the solution you'd like

The attributes should be updated to match the spec described here.

Dropping job and instance attributes in the receiver should be configurable so Prometheus labels can be kept in addition to the semconv labels added. Or this should not be done by receivers at all as it can be done be attribute processor.

Describe alternatives you've considered

Currently using the attributes processor to re-add the job and instance attributes, and to remove the confusing net.* attributes.

Additional context

No response

@robincw robincw added enhancement New feature or request needs triage New item requiring triage labels May 2, 2024
Copy link
Contributor

github-actions bot commented May 2, 2024

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@github-actions github-actions bot added the receiver/prometheus Prometheus receiver label May 2, 2024
@robincw
Copy link
Author

robincw commented May 2, 2024

Similar issue found for mongodb receiver #32810

@dashpole
Copy link
Contributor

dashpole commented May 2, 2024

Dropping job and instance attributes in the receiver should be configurable so Prometheus labels can be kept in addition to the semconv labels added.

Are you referring to job + instance being translated to service.name and service.instance.id? That is required by the translation specification, as service resource attributes are required to uniquely identify timeseries in OTel.

I've opened #32829 to update other attributes used

@robincw
Copy link
Author

robincw commented May 2, 2024

job + instance being translated to service.name and service.instance.id is not a problem, and required by the spec, but dropping them could be a configurable opt-out , I think? This would aid migration of downstream dependencies on the data.

atoulme pushed a commit that referenced this issue May 5, 2025
…eAttributes feature flag (#39803)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This feature flag was introduced in
#32829
to resolve #32814. It was first released in `v0.103.0`, on June 19, 2024
which was 10 months ago. The feature gate is to remove deprecated
resource attributes in favor of the semantic convention equivalents.
This is a breaking change and the feature flag will now be enabled by
default.

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

#32814

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated testing to account for the feature flag being enabled by
default.
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this issue May 6, 2025
…eAttributes feature flag (open-telemetry#39803)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This feature flag was introduced in
open-telemetry#32829
to resolve open-telemetry#32814. It was first released in `v0.103.0`, on June 19, 2024
which was 10 months ago. The feature gate is to remove deprecated
resource attributes in favor of the semantic convention equivalents.
This is a breaking change and the feature flag will now be enabled by
default.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

open-telemetry#32814

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated testing to account for the feature flag being enabled by
default.
vincentfree pushed a commit to ing-bank/opentelemetry-collector-contrib that referenced this issue May 20, 2025
…eAttributes feature flag (open-telemetry#39803)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This feature flag was introduced in
open-telemetry#32829
to resolve open-telemetry#32814. It was first released in `v0.103.0`, on June 19, 2024
which was 10 months ago. The feature gate is to remove deprecated
resource attributes in favor of the semantic convention equivalents.
This is a breaking change and the feature flag will now be enabled by
default.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

open-telemetry#32814

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated testing to account for the feature flag being enabled by
default.
dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this issue May 23, 2025
…eAttributes feature flag (open-telemetry#39803)

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description
This feature flag was introduced in
open-telemetry#32829
to resolve open-telemetry#32814. It was first released in `v0.103.0`, on June 19, 2024
which was 10 months ago. The feature gate is to remove deprecated
resource attributes in favor of the semantic convention equivalents.
This is a breaking change and the feature flag will now be enabled by
default.

<!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. -->
#### Link to tracking issue

open-telemetry#32814

<!--Describe what testing was performed and which tests were added.-->
#### Testing
Updated testing to account for the feature flag being enabled by
default.
crobert-1 added a commit to signalfx/splunk-otel-collector that referenced this issue May 27, 2025
* Update OpenTelemetry Dependencies to latest

* Address breaking change of prometheus resource attribute naming (open-telemetry/opentelemetry-collector-contrib#32814)

* Fix missed resource attributes naming change

---------

Co-authored-by: Curtis Robert <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment