opentelemetry-exporter-otlp-pyproto-http: drop requests, use urllib#7
Draft
ocelotl wants to merge 1 commit into
Draft
opentelemetry-exporter-otlp-pyproto-http: drop requests, use urllib#7ocelotl wants to merge 1 commit into
ocelotl wants to merge 1 commit into
Conversation
Replace requests.Session-based transport with stdlib urllib.request/ urllib.error across the trace, log and metric HTTP exporters, sharing a small _post/_build_ssl_context helper in _common.py. The credential- provider entry point's requests.Session type check is commented out (rather than removed) since there is no longer a requests.Session type to validate against; the session= constructor param and its wiring are dropped since there is no longer a Session object for it to populate.
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.
Summary
requests.Session-based HTTP transport inopentelemetry-exporter-otlp-pyproto-httpwith stdliburllib.request/urllib.error, so the package no longer depends onrequests._build_ssl_context/_posthelpers added to_common.py, used identically bytrace_exporter,_log_exporter, andmetric_exporter.opentelemetry_otlp_credential_providerentry-point mechanism'sisinstance(maybe_session, requests.Session)type check is commented out (not deleted) since there's norequests.Sessiontype left to validate against.session=constructor parameter and its wiring are removed from all three exporters, since there's no moreSessionobject for it to populate._load_session_from_envvaritself remains defined in_common.pybut is now unreferenced by the exporters — this is a real, partial feature regression: the credential-provider plugin mechanism (e.g. a GCP-auth-style pluggable session) is no longer wired into the request path.Test plan
uv run pytest tests/— 91 passedrequestsimport remains insrc/, andrequestsis not loaded as a module at runtimeuv.lockregenerated, no longer listsrequestsas a dependency of this package