Skip to content

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

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

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

Conversation

@herin049
Copy link
Copy Markdown
Contributor

@herin049 herin049 commented May 10, 2026

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
Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

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


Core package (no HTTP backend included)::

pip install opentelemetry-exporter-http-transport
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.

If this is specific to otlp over http, should the package name reflect that: opentelemetry-exporter-otlp-http-transport

Copy link
Copy Markdown
Contributor Author

@herin049 herin049 May 11, 2026

Choose a reason for hiding this comment

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

I was actually debating this exact naming decision, I decided that opentelemetry-exporter-http-transport might be slightly more appropriate than opentelemetry-exporter-otlp-http-transport given that we might want to use the transport abstraction for non-OTLP exporters (e.g. Jaeger). That being said, I still opted to include the OTLPHTTPClient inside this package since it's pretty lean and will be reused by the Proto + JSON HTTP exporters, but we could even break this off into another package, but my thought is this would be a bit overkill. WDYT?

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.

i think either is ok really. If the plan is to use this for exporters other than otlp, then i agree it makes more sense to keep it this way

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.

Shouldn't this be named opentelemetry-exporter-otlp-http-common for consistency with the rest of the packages?

@emdneto
Copy link
Copy Markdown
Member

emdneto commented May 12, 2026

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
Copy link
Copy Markdown
Contributor

@codeboten codeboten left a comment

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.

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

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

Accept httpx.Client instead of requests.Session

5 participants