관리-도구
편집 파일: span_processor.cpython-38.pyc
U �Mg�3 � @ s> d dl m Z mZ d dlmZ d dlmZmZ d dlmZ d dlm Z m Z d dlm Z d dlmZmZmZmZ d dlmZmZ d d lmZmZ d d lmZmZ d dlmZmZ d dlm Z d d l!m"Z"m#Z$ d dl%m&Z& d dl'm(Z) e�rd dlm*Z*m+Z+m,Z, d dl-m.Z/ d dl0m1Z1m2Z2 dZ3dZ4dZ5dd� Z6G dd� de �Z7dS )� )�datetime�timezone)�time)� TYPE_CHECKING�cast)� get_value)� SpanProcessor�ReadableSpan)�SpanAttributes)�format_span_id�format_trace_id�get_current_span�SpanKind)�INVALID_SPAN_ID�INVALID_TRACE_ID)� get_client�start_transaction)�INSTRUMENTER� SPANSTATUS)�SENTRY_BAGGAGE_KEY�SENTRY_TRACE_KEY��add_global_event_processor)�Transaction�Span)�Dsn)� parse_url)�Any�Optional�Union)�context)�Event�HintZotel� z auto.otelc C s� t � }|jd tjkr| S t| d�r4| d dkr4| S t� }|sB| S |�� }|jtks^|j t krb| S |�t|j �d �}|s|| S | � di �}|� di ��|�� � | S )N�instrumenter�typeZtransaction�contexts�trace)r �optionsr �OTEL�hasattrr �get_span_context�trace_idr �span_idr �getr � setdefault�updateZget_trace_context)�event� otel_span_map�client� otel_span�ctx�sentry_spanr&