DistributedTracingPolicy Class

The policy to create spans for Azure calls.

Inheritance
azure.core.pipeline.policies._base.SansIOHTTPPolicy
DistributedTracingPolicy

Constructor

DistributedTracingPolicy(**kwargs)

Parameters

network_span_namer

A callable to customize the span name

tracing_attributes

Attributes to set on all created spans

Methods

end_span

Ends the span that is tracing the network and updates its status.

on_exception

Is executed if an exception is raised while executing the next policy.

This method is executed inside the exception handler.

on_request

Is executed before sending the request from next policy.

on_response

Is executed after the request comes back from the policy.

end_span

Ends the span that is tracing the network and updates its status.

end_span(request: PipelineRequest, response: Optional[HttpResponseType] = None, exc_info: Optional[Tuple] = None) -> None

Parameters

request
Required
response
default value: None
exc_info
default value: None

on_exception

Is executed if an exception is raised while executing the next policy.

This method is executed inside the exception handler.

on_exception(request: PipelineRequest) -> None

Parameters

request
PipelineRequest
Required

The Pipeline request object

on_request

Is executed before sending the request from next policy.

on_request(request: PipelineRequest) -> None

Parameters

request
PipelineRequest
Required

Request to be modified before sent from next policy.

on_response

Is executed after the request comes back from the policy.

on_response(request: PipelineRequest, response: PipelineResponse) -> None

Parameters

request
PipelineRequest
Required

Request to be modified after returning from the policy.

response
PipelineResponse
Required

Pipeline response object

Attributes

TRACING_CONTEXT

TRACING_CONTEXT = 'TRACING_CONTEXT'