Skip to content

Conversation

@pellared
Copy link
Member

@pellared pellared commented May 13, 2025

Fixes #6768

Towards open-telemetry/opentelemetry-specification#4223 (last point from from open-telemetry/opentelemetry-specification#4223 (comment))

  • Remove instrumentation scope attributes as otel_scope_info metric

@pellared pellared added blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made pkg:exporter:prometheus Related to the Prometheus exporter package labels May 13, 2025
@pellared
Copy link
Member Author

@pellared pellared closed this May 20, 2025
@pellared pellared deleted the rm-scope-info branch May 20, 2025 09:01
@pellared pellared restored the rm-scope-info branch May 20, 2025 16:31
@pellared pellared reopened this May 20, 2025
@pellared
Copy link
Member Author

pellared commented May 23, 2025

@dashpole, I think it is safe to merge.

Removing otel_scope_info would only affect a scenario when scope attributes are used. So far it is not a common scenario.

We had an offline conversation with @ArthurSens and @jsuereth, the conclusion was that a migration flag is important for collector components. For Go SDK, if users want to rely on legacy otel_scope_info, they can always use the previously released version of the exporter before the changes were introduced.

@pellared pellared changed the title [DO NOT MERGE] prometheus: remove otel_scope_info prometheus: remove otel_scope_info May 23, 2025
@pellared pellared removed the blocked:specification Waiting on clarification of the OpenTelemetry specification before progress can be made label May 23, 2025
@pellared
Copy link
Member Author

SIG meeting:
We agreed that this can be merged before updating the spec given we have a preliminary consent with OTel-Prometheus SIG and both exporter and spec are "development".

pellared added a commit that referenced this pull request May 24, 2025
…ls (#5947)

Fixes #5846

Towards
open-telemetry/opentelemetry-specification#4223
(first two points from
open-telemetry/opentelemetry-specification#4223 (comment))

- Add instrumentation scope schema URL as `otel_scope_schema_url` label
to exported metrics
- Add instrumentation scope attributes as `otel_scope_[attribute]`
labels to exported metrics

Side notes:

- The exporter does not seem to work correctly if the end user adds e.g.
an `otel_scope_name` attribute. I think the exporter should ignore all
attributes with names that have prefix `otel_scope_`. This scenario is
also not covered by the spec. I think it may be covered by a separate PR
and issue.
- Removal of `otel_scope_info` metric would be handled as a separate PR.
#6770
@MrAlias MrAlias added this to the v1.37.0 milestone May 26, 2025
@MrAlias

This comment was marked as resolved.

@pellared

This comment was marked as resolved.

@pellared pellared merged commit e186baa into open-telemetry:main May 28, 2025
30 checks passed
github-merge-queue bot pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Jun 5, 2025
Fixes
#4223

Prototypes:
- open-telemetry/opentelemetry-go#5947
- open-telemetry/opentelemetry-go#6770
- open-telemetry/opentelemetry-java#7356
-
open-telemetry/opentelemetry-collector-contrib#40060
-
open-telemetry/opentelemetry-collector-contrib#40004



## Changes

Currently (before this PR) [Prometheus and OpenMetrics
Compatibility](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md)
assumes that only scope name and scope version are identifying.

However, with
#4161
this is no longer true.

Therefore, this PR updates the Prometheus and OpenMetrics Compatibility
specification to add the scope name, version, schema URL, scope
attributes to all metrics.

This also removes the `otel_scope_info` as it looks that it won't be
useful. See:
#4223 (comment).

This change important for Collector
open-telemetry/opentelemetry-go#5846 (comment).
It is also is necessary towards stabilization of OTel-Prom/OpenMetrics
compatibility) and the Prometheus exporter.

_Initially, I thought about [splitting it into a few
PRs](#4223 (comment)).
However, it looks like doing it in one PR would be a more complete
approach (also there are not that many changes)._

---------

Co-authored-by: Jade Guiton <[email protected]>
Co-authored-by: Carlos Alberto Cortez <[email protected]>
github-merge-queue bot pushed a commit to open-telemetry/opentelemetry-specification that referenced this pull request Jun 5, 2025
Fixes
#4223

Prototypes:
- open-telemetry/opentelemetry-go#5947
- open-telemetry/opentelemetry-go#6770
- open-telemetry/opentelemetry-java#7356
-
open-telemetry/opentelemetry-collector-contrib#40060
-
open-telemetry/opentelemetry-collector-contrib#40004



## Changes

Currently (before this PR) [Prometheus and OpenMetrics
Compatibility](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md)
assumes that only scope name and scope version are identifying.

However, with
#4161
this is no longer true.

Therefore, this PR updates the Prometheus and OpenMetrics Compatibility
specification to add the scope name, version, schema URL, scope
attributes to all metrics.

This also removes the `otel_scope_info` as it looks that it won't be
useful. See:
#4223 (comment).

This change important for Collector
open-telemetry/opentelemetry-go#5846 (comment).
It is also is necessary towards stabilization of OTel-Prom/OpenMetrics
compatibility) and the Prometheus exporter.

_Initially, I thought about [splitting it into a few
PRs](#4223 (comment)).
However, it looks like doing it in one PR would be a more complete
approach (also there are not that many changes)._

---------

Co-authored-by: Jade Guiton <[email protected]>
Co-authored-by: Carlos Alberto Cortez <[email protected]>
pellared added a commit that referenced this pull request Jun 25, 2025
### Added

- The `go.opentelemetry.io/otel/semconv/v1.33.0` package.
The package contains semantic conventions from the `v1.33.0` version of
the OpenTelemetry Semantic Conventions.
See the [migration documentation](./semconv/v1.33.0/MIGRATION.md) for
information on how to upgrade from
`go.opentelemetry.io/otel/semconv/v1.32.0.`(#6799)
- The `go.opentelemetry.io/otel/semconv/v1.34.0` package.
The package contains semantic conventions from the `v1.34.0` version of
the OpenTelemetry Semantic Conventions. (#6812)
- Add metric's schema URL as `otel_scope_schema_url` label in
`go.opentelemetry.io/otel/exporters/prometheus`. (#5947)
- Add metric's scope attributes as `otel_scope_[attribute]` labels in
`go.opentelemetry.io/otel/exporters/prometheus`. (#5947)
- Add `EventName` to `EnabledParameters` in
`go.opentelemetry.io/otel/log`. (#6825)
- Add `EventName` to `EnabledParameters` in
`go.opentelemetry.io/otel/sdk/log`. (#6825)
- Changed handling of `go.opentelemetry.io/otel/exporters/prometheus`
metric renaming to add unit suffixes when it doesn't match one of the
pre-defined values in the unit suffix map. (#6839)

### Changed

- The semantic conventions have been upgraded from `v1.26.0` to
`v1.34.0` in `go.opentelemetry.io/otel/bridge/opentracing`. (#6827)
- The semantic conventions have been upgraded from `v1.26.0` to
`v1.34.0` in `go.opentelemetry.io/otel/exporters/zipkin`. (#6829)
- The semantic conventions have been upgraded from `v1.26.0` to
`v1.34.0` in `go.opentelemetry.io/otel/metric`. (#6832)
- The semantic conventions have been upgraded from `v1.26.0` to
`v1.34.0` in `go.opentelemetry.io/otel/sdk/resource`. (#6834)
- The semantic conventions have been upgraded from `v1.26.0` to
`v1.34.0` in `go.opentelemetry.io/otel/sdk/trace`. (#6835)
- The semantic conventions have been upgraded from `v1.26.0` to
`v1.34.0` in `go.opentelemetry.io/otel/trace`. (#6836)
- `Record.Resource` now returns `*resource.Resource` instead of
`resource.Resource` in `go.opentelemetry.io/otel/sdk/log`. (#6864)
- Retry now shows error cause for context timeout in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`,
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`,
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploggrpc`,
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`,
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`,
`go.opentelemetry.io/otel/exporters/otlp/otlplog/otlploghttp`. (#6898)

### Fixed

- Stop stripping trailing slashes from configured endpoint URL in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc`.
(#6710)
- Stop stripping trailing slashes from configured endpoint URL in
`go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp`.
(#6710)
- Stop stripping trailing slashes from configured endpoint URL in
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc`.
(#6710)
- Stop stripping trailing slashes from configured endpoint URL in
`go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp`.
(#6710)
- Validate exponential histogram scale range for Prometheus
compatibility in `go.opentelemetry.io/otel/exporters/prometheus`.
(#6822)
- Context cancellation during metric pipeline produce does not corrupt
data in `go.opentelemetry.io/otel/sdk/metric`. (#6914)

### Removed

- `go.opentelemetry.io/otel/exporters/prometheus` no longer exports
`otel_scope_info` metric. (#6770)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg:exporter:prometheus Related to the Prometheus exporter package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prometheus: Remove otel_scope_info metric

4 participants