Repository navigation
opentelemetry-exporter-otlp-proto-http: refactor to use shared opentelemetry-exporter-otlp-common and opentelemetry-exporter-http-transport packages - #5389
Merged
Conversation
…lemetry-exporter-otlp-common and opentelemetry-exporter-http-transport packages
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors opentelemetry-exporter-otlp-proto-http to delegate HTTP transport, retry/backoff, compression, and configuration resolution to the shared opentelemetry-exporter-otlp-common and opentelemetry-exporter-http-transport packages, and updates tests/build wiring accordingly.
Changes:
- Replaces per-exporter HTTP/retry/compression logic with shared
opentelemetry.exporter.otlp.common._http.OTLPHTTPClientand new helpers inproto.http._common. - Updates
opentelemetry-exporter-otlp-proto-httpdependencies/extras sorequestsis optional (via an extra) while default transport uses urllib3. - Reworks unit/functional tests to validate behavior via transport-level request interception and deterministic retry timing.
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| uv.lock | Adds locked workspace deps for opentelemetry-exporter-otlp-common and opentelemetry-exporter-http-transport; moves requests behind an extra. |
| tox.ini | Ensures tox envs install the new shared exporter packages. |
| tests/opentelemetry-docker-tests/tests/otlpexporter/test_otlp_http_exporter_functional.py | Updates functional test helper to hook the new _export_batch path. |
| pyproject.toml | Adds opentelemetry-exporter-otlp-common to workspace dependencies. |
| exporter/opentelemetry-exporter-otlp/test-requirements.txt | Adds editable installs for new shared packages + transport extras for OTLP exporter tests. |
| exporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_span_exporter.py | Rewrites span exporter tests for shared transport/client behavior (mocket-based). |
| exporter/opentelemetry-exporter-otlp-proto-http/tests/test_proto_log_exporter.py | Rewrites log exporter tests for shared transport/client behavior (mocket-based). |
| exporter/opentelemetry-exporter-otlp-proto-http/tests/metrics/test_otlp_metrics_exporter.py | Updates metrics exporter tests for shared transport/client behavior and batch splitting. |
| exporter/opentelemetry-exporter-otlp-proto-http/tests/test_common.py | Adds targeted unit tests for new _common resolution/build helpers. |
| exporter/opentelemetry-exporter-otlp-proto-http/tests/init.py | Adds a shared _mock_clock helper for deterministic retry/backoff testing. |
| exporter/opentelemetry-exporter-otlp-proto-http/test-requirements.txt | Adds mocket and new editable workspace dependencies for this package’s tests. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/trace_exporter/init.py | Switches span exporter implementation to shared OTLP HTTP client + common config helpers. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/metric_exporter/init.py | Switches metrics exporter implementation to shared OTLP HTTP client + common config helpers. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_log_exporter/init.py | Switches log exporter implementation to shared OTLP HTTP client + common config helpers. |
| exporter/opentelemetry-exporter-otlp-proto-http/src/opentelemetry/exporter/otlp/proto/http/_common/init.py | Adds shared endpoint/header/timeout/compression resolution and transport construction helpers. |
| exporter/opentelemetry-exporter-otlp-proto-http/pyproject.toml | Replaces hard dependency on requests with shared packages; adds requests extra. |
| docs/conf.py | Updates intersphinx + nitpick ignores for new types referenced in docs. |
| docs-requirements.txt | Installs opentelemetry-exporter-otlp-proto-http[requests] for doc builds. |
| .changelog/5389.changed | Adds changelog entry for the refactor. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
4 of 6 tasks
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 11, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Aug 12, 2026
Eason09053360
added a commit
to Eason09053360/opentelemetry-python
that referenced
this pull request
Aug 26, 2026
The gRPC exporters parse their timeout environment variables with a bare float(), so a value like OTEL_EXPORTER_OTLP_TIMEOUT=10s raises ValueError during exporter construction and takes down SDK startup. Add a shared _timeout_from_env() helper in opentelemetry-exporter-otlp- proto-common that warns and falls back instead, matching how the repo already handles invalid temporality and export-interval values, and use it from the gRPC mixin and the three signal exporters. Precedence between the signal-specific and generic variables is unchanged. Also fix `timeout or ...` silently discarding an explicit timeout=0; it is now `timeout is not None`. The HTTP exporters got the same treatment in open-telemetry#5389, so this change is limited to the gRPC exporters.
5 tasks done
3 tasks
RosieOh
added a commit
to RosieOh/phoenix
that referenced
this pull request
Sep 28, 2026
…o-http 1.45 opentelemetry-exporter-otlp-proto-http 1.45.0 moved the exporter's headers onto its internal HTTP client (open-telemetry/opentelemetry-python#5389), so reading HTTPSpanExporter._headers raised AttributeError whenever register() built the tracing details with the HTTP transport. Read the headers from the exporter's client when the exporter has none, and leave out the headers the exporter adds on its own so the tracing details show the same headers as before.
This was referenced Sep 28, 2026
axiomofjoy
added a commit
to Arize-ai/phoenix
that referenced
this pull request
Sep 28, 2026
…o-http 1.45 (#16549) * fix(otel): fix register() crash with opentelemetry-exporter-otlp-proto-http 1.45 opentelemetry-exporter-otlp-proto-http 1.45.0 moved the exporter's headers onto its internal HTTP client (open-telemetry/opentelemetry-python#5389), so reading HTTPSpanExporter._headers raised AttributeError whenever register() built the tracing details with the HTTP transport. Read the headers from the exporter's client when the exporter has none, and leave out the headers the exporter adds on its own so the tracing details show the same headers as before. * fix(otel): require opentelemetry-exporter-otlp-proto-http>=1.45 and read headers from the client The compat branch that read HTTPSpanExporter._headers on older versions is gone; phoenix-otel now requires the exporter release that moved headers onto the internal HTTP client, and _exporter_headers reads them from there. The root dev pins move to 1.45.0/0.66b0 so the workspace lockfile resolves. opentelemetry-api 1.45 defines AttributeValue by chained assignment, which mypy does not accept as a type alias, so phoenix.trace.attributes now carries an equivalent alias and the server imports it from there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> --------- Co-authored-by: Alexander Song <axiomofjoy@gmail.com> Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
This was referenced Sep 29, 2026
Eason09053360
added a commit
to Eason09053360/opentelemetry-python
that referenced
this pull request
Oct 1, 2026
Only the gRPC exporters use it now that the HTTP side landed in open-telemetry#5389. It lives in the package __init__ rather than exporter.py because the logger there has a DuplicateFilter keyed on the message template, which would drop the warning for a second invalid variable.
Dotify71
pushed a commit
to Dotify71/opentelemetry-python
that referenced
this pull request
Oct 7, 2026
…vars (open-telemetry#5448) * Fall back to the default when an OTLP gRPC timeout env var is invalid The gRPC exporters parse their timeout environment variables with a bare float(), so a value like OTEL_EXPORTER_OTLP_TIMEOUT=10s raises ValueError during exporter construction and takes down SDK startup. Add a shared _timeout_from_env() helper in opentelemetry-exporter-otlp- proto-common that warns and falls back instead, matching how the repo already handles invalid temporality and export-interval values, and use it from the gRPC mixin and the three signal exporters. Precedence between the signal-specific and generic variables is unchanged. Also fix `timeout or ...` silently discarding an explicit timeout=0; it is now `timeout is not None`. The HTTP exporters got the same treatment in open-telemetry#5389, so this change is limited to the gRPC exporters. * Move _timeout_from_env into the gRPC exporter package Only the gRPC exporters use it now that the HTTP side landed in open-telemetry#5389. It lives in the package __init__ rather than exporter.py because the logger there has a DuplicateFilter keyed on the message template, which would drop the warning for a second invalid variable. * Leave the timeout=0 handling unchanged Honouring an explicit timeout=0 makes the gRPC exporter set a deadline that has already passed, so every export fails with DEADLINE_EXCEEDED. Declarative config passes timeout=0 for "no limit", so that needs its own change. Keep the existing `timeout or ...` fallback here. --------- Co-authored-by: Lukas Hering <40302054+herin049@users.noreply.github.com>
herin049
pushed a commit
to RichardoMrMu/opentelemetry-python
that referenced
this pull request
Oct 12, 2026
…ar (open-telemetry#5705) * fix(prometheus): tolerate invalid OTEL_EXPORTER_PROMETHEUS_PORT env var _AutoPrometheusMetricReader parsed OTEL_EXPORTER_PROMETHEUS_PORT with a bare int() in __init__, so a non-integer value (e.g. "9464abc") or an empty string raised ValueError while building the auto-configured reader and took opentelemetry-instrument/SDK startup down. This is the same class of startup crash already fixed for the OTLP exporters (HTTP _resolve_timeout in open-telemetry#5389, gRPC _timeout_from_env in open-telemetry#5448) and the Zipkin exporters (open-telemetry#5704). Add a private _port_from_env() that skips unset/empty values silently, logs a warning for non-integer values, and falls back to the 9464 default. Explicit configuration is unaffected (the reader's auto server only reads the env var). Assisted-by: Doubao * changelog: add fragment for PR open-telemetry#5705 * test(prometheus): ruff-format the new entrypoint timeout tests The `misc / precommit` job failed because the two added test signatures were split across lines while ruff (v0.16.0, line-length 120) keeps them on one line. Run `ruff format` so `pre-commit run ruff-format` is clean.
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
Refactors the
opentelemetry-exporter-otlp-proto-httppackage to use the new sharedopentelemetry-exporter-otlp-commonandopentelemetry-exporter-http-transport packagespackages.Fixes #2990
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: