opentelemetry-python-contrib This Week: Query Redaction, GCP Cloud Run Detection and urllib Fixes

I looked at the last week of commits in opentelemetry-python-contrib, the home of the Python instrumentation packages, resource detectors and distro code. Eleven commits landed, mostly on November 19. The highlights are a new query string redaction helper, richer GCP resource detection including Cloud Run Jobs, and a batch of fixes in the urllib instrumentation.

Query string redaction lands in util-http

The biggest change is the redact_query_string helper (#4944). It adds a redact_query_string function to opentelemetry-util-http and applies it in the WSGI instrumentation, touching the main util-http module and the WSGI instrumentation.

Why it matters: WSGI spans often carry the full request URL, query string included. Tokens and session ids in the query end up on spans and in your backend. Redaction is now centralized in the util package instead of each instrumentation doing its own thing.

Related hardening in the same area: a fix that ignores blank entries in captured and sanitized header lists (#5305). Empty strings in header config no longer produce confusing capture behavior.

GCP resource detector: Cloud Run Jobs and cloud.resource_id

The GCP detector got a meaningful update in PR #5352, merged as this commit. Two things changed:

  • The detector populates the cloud.resource_id semantic convention attribute
  • It detects Cloud Run Jobs, not just Cloud Run services, with the new FaaS detection logic in _faas.py

If you run jobs on Cloud Run, your resource attributes should now identify them correctly instead of falling back to generic values. The change comes with new tests and updated snapshots for the detector output.

On the Azure side, the resource detector was prepared and released as v0.4.0 and then bumped to v0.5.0 development.

urllib client metrics and timeouts

The urllib instrumentation saw two user visible fixes:

Also in the HTTP family: the Starlette docs were corrected around capturing all headers, and the Tornado instrumentation now passes client span attributes at span creation (#5348), which avoids sampling decisions made before attributes are attached.

Distro, logging API and test bumps

Smaller but useful items:

self.assertEqual("otlp", os.environ.get(OTEL_LOGS_EXPORTER))

What to watch

  • The WSGI redaction change is a good template. Expect the same redact_query_string helper to show up in ASGI and other HTTP instrumentations.
  • Check your urllib HTTP client metric dashboards after the next release. New server.address and server.port attributes change metric cardinality.
  • If you run Cloud Run Jobs on GCP, verify the detected resource attributes after upgrading the GCP detector package.

← All updates