opentelemetry-exporter-otlp-common: remove dependence on incubating attributes from OTLP exporters#5387
Open
herin049 wants to merge 3 commits into
Open
opentelemetry-exporter-otlp-common: remove dependence on incubating attributes from OTLP exporters#5387herin049 wants to merge 3 commits into
herin049 wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors OTLP exporter internal-metrics helpers so OTLP exporters no longer import incubating semconv OTEL component attributes/metrics directly, by moving exporter-metrics utilities into opentelemetry-exporter-otlp-common and duplicating the required semconv constants there.
Changes:
- Moved exporter-metrics implementation/semconv constants into
opentelemetry.exporter.otlp.common._exporter_metricsand updated OTLP exporters to import from the new location. - Added
opentelemetry-exporter-otlp-commonas a dependency where needed (workspace deps, tox envs, and per-package test requirements). - Added a changelog entry documenting the fix.
Reviewed changes
Copilot reviewed 24 out of 25 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds opentelemetry-api and opentelemetry-exporter-otlp-common to relevant locked dependency sets. |
| tox.ini | Ensures tox OTLP exporter envs install opentelemetry-exporter-otlp-common. |
| tests/opentelemetry-test-utils/test-requirements.txt | Adds opentelemetry-exporter-otlp-common to test utils requirements. |
| pyproject.toml | Adds opentelemetry-exporter-otlp-common to the workspace dependencies. |
| exporter/opentelemetry-exporter-otlp/test-requirements.txt | Adds opentelemetry-exporter-otlp-common to OTLP exporter tests. |
| exporter/opentelemetry-exporter-otlp-proto-http/test-requirements.txt | Adds opentelemetry-exporter-otlp-common to OTLP proto-http tests. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/init.py | Switches exporter-metrics imports to otlp.common._exporter_metrics and removes incubating OTEL component attribute import. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/init.py | Switches exporter-metrics imports to otlp.common._exporter_metrics and removes incubating OTEL component attribute import. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/init.py | Switches exporter-metrics imports to otlp.common._exporter_metrics and removes incubating OTEL component attribute import. |
| exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml | Adds runtime dependency on opentelemetry-exporter-otlp-common. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/tests/test_otlp_exporter_mixin.py | Updates tests to use OtelComponentTypeValues from otlp.common._exporter_metrics. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements.oldest.txt | Regenerates pinned test requirements to include opentelemetry-exporter-otlp-common. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements.latest.txt | Regenerates pinned test requirements to include opentelemetry-exporter-otlp-common. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/test-requirements.in | Adds opentelemetry-exporter-otlp-common to proto-grpc test inputs. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/init.py | Updates import of OtelComponentTypeValues to come from otlp.common._exporter_metrics. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/metric_exporter/init.py | Updates import of OtelComponentTypeValues to come from otlp.common._exporter_metrics. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/exporter.py | Switches exporter-metrics imports to otlp.common._exporter_metrics. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/src/opentelemetry/exporter/otlp/proto/grpc/_log_exporter/init.py | Updates import of OtelComponentTypeValues to come from otlp.common._exporter_metrics. |
| exporter/opentelemetry-exporter-otlp-proto-grpc/pyproject.toml | Adds runtime dependency on opentelemetry-exporter-otlp-common. |
| exporter/opentelemetry-exporter-otlp-common/tests/test_exporter_metrics.py | Updates tests to import exporter-metrics from otlp.common._exporter_metrics. |
| exporter/opentelemetry-exporter-otlp-common/src/opentelemetry/exporter/otlp/common/_exporter_metrics/semconv.py | Introduces duplicated semconv constants and meter instrument factories (to avoid incubating semconv imports). |
| exporter/opentelemetry-exporter-otlp-common/src/opentelemetry/exporter/otlp/common/_exporter_metrics/init.py | Rewires exporter-metrics implementation to use the local semconv constants/factories. |
| exporter/opentelemetry-exporter-otlp-common/pyproject.toml | Adds opentelemetry-api dependency (needed for metrics API usage). |
| docs/getting_started/tests/requirements.txt | Adds opentelemetry-exporter-otlp-common to docs getting-started tests requirements. |
| .changelog/5387.fixed | Adds changelog entry for the fix. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Previously, the
opentelemetry-exporter-otlp-proto-commonpackage (utilized by the gRPC and Protobuf exporters), made direct use of incubating attributes fromopentelemetry.semconv._incubating.*which does not guarantee stability with future versions of this package, despite the loose version constraints in thepyproject.toml. To address this issue, the exporter metrics classes/utilities have been moved to theopentelemetry-exporter-otlp-commonpackage and the incubating/unstable attributes/functions have been included directly into this package, leaving no explicit dependency on the Semconv package. Moving the exporter metrics logic toopentelemetry-exporter-otlp-commonis also necessary for adding exporter metrics to the new OTLP JSON exporter (since this exporter can not depend onopentelemetry-exporter-otlp-proto-common).Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Tox
Does This PR Require a Contrib Repo Change?
Checklist: