1.0.0b7 (2026-02-05)
Features Added
- Native tracing support was added. #39172
- The
OpenTelemetryTracerclass was added to thecorehttp.instrumentation.tracing.opentelemetrymodule. This is a wrapper around the OpenTelemetry tracer that is used to create spans for SDK operations. - Added a
get_tracermethod to the newcorehttp.instrumentationmodule. This method returns an instance of theOpenTelemetryTracerclass if OpenTelemetry is available. - A
TracingOptionsTypedDict class was added to define the options that SDK users can use to configure tracing per-operation. These options include the ability to enable or disable tracing and set additional attributes on spans.- Example usage:
client.method(tracing_options={"enabled": True, "attributes": {"foo": "bar"}})
- Example usage:
DistributedHttpTracingPolicyanddistributed_trace/distributed_trace_asyncdecorators were added to support OpenTelemetry tracing for SDK operations.- SDK clients can define an
_instrumentation_configclass variable to configure the OpenTelemetry tracer used in method span creation. Possible configuration options arelibrary_name,library_version,schema_url, andattributes.
- SDK clients can define an
- The
- Added a global settings object,
corehttp.settings, to thecorehttppackage. This object can be used to set global settings for thecorehttppackage. Currently the only setting istracing_enabledfor enabling/disabling tracing. #39172 - Added
start_timeandcontextkeyword arguments toOpenTelemetryTracer.start_spanandstart_as_current_spanmethods. - Added
set_span_error_statusstatic method toOpenTelemetryTracerfor setting a span's status to ERROR. - Added
is_generated_model,attribute_list, andTypeHandlerRegistrytocorehttp.serializationmodule for SDK model handling.
Bugs Fixed
- Fixed
retry_backoff_maxbeing ignored in retry policies when configuring retries. - Raise correct exception if transport is used while already closed.
- A timeout error when using the
aiohttptransport will now be raised as acorehttp.exceptions.ServiceResponseTimeoutError, a subtype of the previously raisedServiceResponseError. - When using with
aiohttp3.10 or later, a connection timeout error will now be raised as acorehttp.exceptions.ServiceRequestTimeoutError, which can be retried. - Fixed leaked requests and aiohttp exceptions for streamed responses.
- Improved granularity of
ServiceRequestErrorandServiceResponseErrorexceptions raised in timeout scenarios from the requests and aiohttp transports. BearerTokenCredentialPolicyandAsyncBearerTokenCredentialPolicywill now properly chain exceptions raised during claims challenge handling. If a credential raises an exception when attempting to acquire a token in response to a claims challenge, that exception will be raised with the original 401 response as the cause.
Other Changes
- Added
opentelemetry-apias an optional dependency for tracing. #39172