opentelemetry.propagators.cloud_trace_propagator¶
Cloud Trace Span Propagator for X-Cloud-Trace-Context format.
Usage¶
from opentelemetry.propagate import set_global_textmap
from opentelemetry.propagators.cloud_trace_propagator import (
CloudTraceFormatPropagator,
)
# Set the X-Cloud-Trace-Context header
set_global_textmap(CloudTraceFormatPropagator())
Auto-instrumentation¶
This exporter can also be used with the OTEL_PROPAGATORS
environment variable as
OTEL_PROPAGATORS=gcp_trace
.
This also works with OpenTelemetry auto-instrumentation:
opentelemetry-instrument --propagator gcp_trace <command> <args>
API¶
Classes
This class is for injecting into a carrier the SpanContext in Google Cloud format, or extracting the SpanContext from a carrier using Google Cloud format. |
|
This class extracts Trace Context in the Google Cloud format, but does not inject this header. |