Skip to content

feat: add opentelemetry-exporter-http-transport package#5194

Open
herin049 wants to merge 28 commits into
open-telemetry:mainfrom
herin049:feat/exporter-otlp-http
Open

feat: add opentelemetry-exporter-http-transport package#5194
herin049 wants to merge 28 commits into
open-telemetry:mainfrom
herin049:feat/exporter-otlp-http

Conversation

@herin049

@herin049 herin049 commented May 10, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a common opentelemetry-exporter-http-transport package that will be utilized by multiple HTTP exporter packages (initially OTLP JSON) to abstract away and generalize underlying HTTP transport implementations and exporting with OTLP. Introducing this package will significantly reduce the amount of code duplication present in HTTP exporters and will allow for the usage of alternative HTTP client libraries.

Fixes #3439, #4171, #1003, #2990

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-exporter-http-transport

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • Documentation has been updated

@herin049 herin049 marked this pull request as ready for review May 11, 2026 02:23
@herin049 herin049 requested a review from a team as a code owner May 11, 2026 02:23

@codeboten codeboten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really exciting. Thanks @herin049, just one question regarding the naming

Comment thread exporter/opentelemetry-exporter-http-transport/README.rst
@emdneto

emdneto commented May 12, 2026

Copy link
Copy Markdown
Member

Thanks for the PR!

Just a heads-up: we no longer update CHANGELOG.md directly. The changelog is now generated from changelog fragments using Towncrier.

Please add the appropriate changelog fragment for this change instead of editing CHANGELOG.md manually. You can find the instructions and expected format in CONTRIBUTING.md.

@tammy-baylis-swi tammy-baylis-swi moved this to Ready for review in Python PR digest May 13, 2026

@codeboten codeboten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there already a branch somewhere showing how this package can be used inside some of the other http exporters?

@herin049

Copy link
Copy Markdown
Contributor Author

Is there already a branch somewhere showing how this package can be used inside some of the other http exporters?

@codeboten I've opened #5219 which includes the full changes updating the OTLP Proto HTTP exporter to use this new package. I've also switched to start using urllib3 as the default transport backend, as long as the user doesn't specify otherwise. All of the changes in #5219 are designed to be fully backwards compatible.

@MikeGoldsmith MikeGoldsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favour of this change, it makes a lot of sense to have a shared package.

I've left some comments here, and will add to the on-going conversation around naming.

@herin049 herin049 requested review from MikeGoldsmith, Copilot and ocelotl and removed request for ocelotl May 27, 2026 23:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new opentelemetry-exporter-http-transport package intended to provide shared HTTP transport abstractions for exporter implementations, including optional requests and urllib3 backends.

Changes:

  • Introduces base HTTP result/transport interfaces and concrete requests/urllib3 transport implementations.
  • Adds package metadata, README, changelog, lockfile/workspace wiring, tox environments, and CI jobs.
  • Adds unit tests and test requirements for both HTTP backend implementations.

Reviewed changes

Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
.changelog/5194.added Adds changelog fragment for the new package.
.github/workflows/lint.yml Adds lint CI job for the new package.
.github/workflows/test.yml Adds test CI jobs for the new package across Python/platform/version matrices.
dev-requirements.txt Adds mocket for test/lint dependency resolution.
eachdist.ini Registers the new package in prerelease distribution tooling.
exporter/opentelemetry-exporter-http-transport/LICENSE Adds package license file.
exporter/opentelemetry-exporter-http-transport/README.rst Documents installation and purpose of the new package.
exporter/opentelemetry-exporter-http-transport/pyproject.toml Defines package metadata, extras, and build configuration.
exporter/opentelemetry-exporter-http-transport/src/opentelemetry/exporter/http/transport/__init__.py Adds package namespace module.
exporter/opentelemetry-exporter-http-transport/src/opentelemetry/exporter/http/transport/_base.py Adds abstract HTTP transport/result interfaces.
exporter/opentelemetry-exporter-http-transport/src/opentelemetry/exporter/http/transport/_requests.py Adds requests-based HTTP transport/result implementation.
exporter/opentelemetry-exporter-http-transport/src/opentelemetry/exporter/http/transport/_urllib3.py Adds urllib3-based HTTP transport/result implementation.
exporter/opentelemetry-exporter-http-transport/src/opentelemetry/exporter/http/transport/version/__init__.py Adds package version module.
exporter/opentelemetry-exporter-http-transport/test-requirements.in Defines test dependency inputs.
exporter/opentelemetry-exporter-http-transport/test-requirements.latest.txt Adds compiled latest test dependencies.
exporter/opentelemetry-exporter-http-transport/test-requirements.oldest.txt Adds compiled oldest test dependencies.
exporter/opentelemetry-exporter-http-transport/tests/__init__.py Adds test package marker.
exporter/opentelemetry-exporter-http-transport/tests/test_requests_transport.py Adds tests for the requests transport.
exporter/opentelemetry-exporter-http-transport/tests/test_urllib3_transport.py Adds tests for the urllib3 transport.
pyproject.toml Adds workspace and pyright wiring for the new package.
tox.ini Adds tox test/lint environments and pyright dependency wiring.
uv.lock Adds lockfile entries for the new workspace package and extras.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread exporter/opentelemetry-exporter-http-transport/README.rst Outdated
Comment thread exporter/opentelemetry-exporter-http-transport/pyproject.toml

@MikeGoldsmith MikeGoldsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @herin049!

@codeboten codeboten left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@herin049 herin049 moved this from Ready for review to Ready for merge in Python PR digest Jun 10, 2026
@herin049

Copy link
Copy Markdown
Contributor Author

@lzchen All conversations should be resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready for merge

Development

Successfully merging this pull request may close these issues.

Accept httpx.Client instead of requests.Session

9 participants