/var/opt/nydus/ops/mysql/connector/opentelemetry/__pycache__
Edit: /var/opt/nydus/ops/mysql/connector/opentelemetry/__pycache__/context_propagation.cpython-312.pyc (3441B)
Nj | d Z ddlmZmZmZ ddlmZmZ erddlm Z ddl
mZmZ erddl
mZ d ed
efdZded
efd
Zy)z$Trace context propagation utilities. )
TYPE_CHECKINGAnyCallable )OTEL_ENABLEDTRACEPARENT_HEADER_NAME)trace)format_span_idformat_trace_id )MySQLConnectionAbstractspanreturnc | j }d}t |j }t |j }d}dj ||||g S )ah Build a traceparent header according to the provided span.
The context information from the provided span is used to build the traceparent
header that will be propagated to the MySQL server. For particulars regarding
the header creation, refer to [1].
This method assumes version 0 of the W3C specification.
Args:
span (opentelemetry.trace.span.Span): current span in trace.
Returns:
traceparent_header (str): HTTP header field that identifies requests in a
tracing system.
References:
[1]: https://www.w3.org/TR/trace-context/#traceparent-header
00-)get_span_contextr trace_idr
span_idjoin)r ctxversionr r trace_flagss b/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/opentelemetry/context_propagation.pybuild_traceparent_headerr 0 sP (
!CGs||,HS[[)GK88Wh=>> methodc <