Skip to content

opentelemetry-exporter-otlp-pyproto-http: drop requests, use urllib#7

Draft
ocelotl wants to merge 1 commit into
pyprotofrom
no-requests
Draft

opentelemetry-exporter-otlp-pyproto-http: drop requests, use urllib#7
ocelotl wants to merge 1 commit into
pyprotofrom
no-requests

Conversation

@ocelotl

@ocelotl ocelotl commented Jul 3, 2026

Copy link
Copy Markdown
Owner

Summary

  • Replace requests.Session-based HTTP transport in opentelemetry-exporter-otlp-pyproto-http with stdlib urllib.request/urllib.error, so the package no longer depends on requests.
  • Shared _build_ssl_context/_post helpers added to _common.py, used identically by trace_exporter, _log_exporter, and metric_exporter.
  • The opentelemetry_otlp_credential_provider entry-point mechanism's isinstance(maybe_session, requests.Session) type check is commented out (not deleted) since there's no requests.Session type left to validate against.
  • The session= constructor parameter and its wiring are removed from all three exporters, since there's no more Session object for it to populate. _load_session_from_envvar itself remains defined in _common.py but 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 passed
  • Confirmed no requests import remains in src/, and requests is not loaded as a module at runtime
  • uv.lock regenerated, no longer lists requests as a dependency of this package

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant