/var/opt/nydus/ops/mysql/connector/opentelemetry/__pycache__
NameSizeModeActions
constants.cpython-312.pyc11410644editdlrm
context_propagation.cpython-312.pyc34410644editdlrm
instrumentation.cpython-312.pyc295750644editdlrm
__init__.cpython-312.pyc1840644editdlrm
Edit: /var/opt/nydus/ops/mysql/connector/opentelemetry/__pycache__/context_propagation.cpython-312.pyc (3441B)
N j|dZddlmZmZmZddlmZmZerddlm Z ddl m Z m Z erddl mZd ed efd Zd ed 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 ||||gS)ahBuild 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)rctxversionrr trace_flagss b/opt/nydus/tmp/pip-target-a90h98xg/lib/python/mysql/connector/opentelemetry/context_propagation.pybuild_traceparent_headerr0sP(    !CGs||,HS[[)GK 88Wh= >>methodc<dddtdtdtffd }|S)aPerform trace context propagation. The trace context is propagated via query attributes. The `traceparent` header from W3C specification [1] is used, in this sense, the attribute name is `traceparent` (is RESERVED, avoid using it), and its value is built as per instructed in [1]. If opentelemetry API/SDK is unavailable or there is no recording span, trace context propagation is skipped. References: [1]: https://www.w3.org/TR/trace-context/#traceparent-header cnxr argskwargsrc\tr |js |g|i|Stj}d}|j r#t |}|j t|f |g|i|}||jt|S#||jtwwxYw)zContext propagation decorator.N)value)name) rotel_context_propagationr get_current_span is_recordingrquery_attrs_appendrquery_attrs_remove)rr r! current_span tp_headerresultrs rwrapperz)with_context_propagation..wrapper]s3#?#?#/// /--/   $ $ &0>I  " "*A9)M " N EC1$1&1F$&&,C&D $&&,C&D%s * BB+)r)rr-s` rwith_context_propagationr.Ns,.scc& NrN)__doc__typingrrr constantsrr opentelemetryr opentelemetry.trace.spanr r abstractsr strrr.rrr7sN:+0/<$H3?3?3?<"X"("r