DistributedHttpTracingPolicy Class

The policy to create tracing spans for API calls.

Constructor

DistributedHttpTracingPolicy(*, instrumentation_config: Mapping[str, Any] | None = None, **kwargs: Any)

Keyword-Only Parameters

Name Description
instrumentation_config

Configuration for the instrumentation providers.

Default value: None

Methods

on_request

Starts a span for the network call.

on_response

Ends the span for the network call and updates its status.

on_request

Starts a span for the network call.

on_request(request: PipelineRequest[HttpRequest]) -> None

Parameters

Name Description
request
Required
<xref:<xref:corehttp.runtime.pipeline#corehttp.runtime.pipeline.PipelineRequest>>

The PipelineRequest object.

on_response

Ends the span for the network call and updates its status.

on_response(request: PipelineRequest[HttpRequest], response: PipelineResponse[HttpRequest, SansIOHttpResponse]) -> None

Parameters

Name Description
request
Required
<xref:<xref:corehttp.runtime.pipeline#corehttp.runtime.pipeline.PipelineRequest>>

The PipelineRequest object.

response
Required
<xref:<xref:corehttp.runtime.pipeline#corehttp.runtime.pipeline.PipelineResponse>>

The PipelineResponse object.

Attributes

TRACING_CONTEXT

TRACING_CONTEXT = 'TRACING_CONTEXT'