Ë
    ÿÿæi*  ã                   ó¤  — U d Z ddlmZ ddlmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZmZ ddlmZ  ee«      Zd	ej&                  fd
ej(                  dee	   dej*                  ej(                     de	fd„Zd	ej.                  fd
ej(                  dee	   dej0                  ej(                     dd	fd„Zg Zeej6                     ed<    ej:                  ed«      Zej?                  d«      D ]s  Z e jC                  «       Z e jE                  «       dk(  rejG                  d«       g Z n;	 ejI                    e% e& ede ¬«      «      «      jO                  «       «       «       Œu  ejX                  e«      a-ej6                  ed<   dej6                  fd„Z.dej6                  dd	fd„Z/y	# e($ r  e)de › d�«      ‚e*$ r ejW                  de «       ‚ w xY w)a`  
API for propagation of context.

The propagators for the
``opentelemetry.propagators.composite.CompositePropagator`` can be defined
via configuration in the ``OTEL_PROPAGATORS`` environment variable. This
variable should be set to a comma-separated string of names of values for the
``opentelemetry_propagator`` entry point. For example, setting
``OTEL_PROPAGATORS`` to ``tracecontext,baggage`` (which is the default value)
would instantiate
``opentelemetry.propagators.composite.CompositePropagator`` with 2
propagators, one of type
``opentelemetry.trace.propagation.tracecontext.TraceContextTextMapPropagator``
and other of type ``opentelemetry.baggage.propagation.W3CBaggagePropagator``.
Notice that these propagator classes are defined as
``opentelemetry_propagator`` entry points in the ``pyproject.toml`` file of
``opentelemetry``.

Example::

    import flask
    import requests
    from opentelemetry import propagate


    PROPAGATOR = propagate.get_global_textmap()


    def get_header_from_flask_request(request, key):
        return request.headers.get_all(key)

    def set_header_into_requests_request(request: requests.Request,
                                            key: str, value: str):
        request.headers[key] = value

    def example_route():
        context = PROPAGATOR.extract(
            get_header_from_flask_request,
            flask.request
        )
        request_to_downstream = requests.Request(
            "GET", "http://httpbin.org/get"
        )
        PROPAGATOR.inject(
            set_header_into_requests_request,
            request_to_downstream,
            context=context
        )
        session = requests.Session()
        session.send(request_to_downstream.prepare())


.. _Propagation API Specification:
    https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md
é    )Ú	getLogger)Úenviron)ÚListÚOptional)ÚContext)ÚOTEL_PROPAGATORS)Ú	compositeÚtextmap)Úentry_pointsNÚcarrierÚcontextÚgetterÚreturnc                 ó:   — t        «       j                  | ||¬«      S )aZ  Uses the configured propagator to extract a Context from the carrier.

    Args:
        getter: an object which contains a get function that can retrieve zero
            or more values from the carrier and a keys function that can get all the keys
            from carrier.
        carrier: and object which contains values that are
            used to construct a Context. This object
            must be paired with an appropriate getter
            which understands how to extract a value from it.
        context: an optional Context to use. Defaults to root
            context if not set.
    )r   )Úget_global_textmapÚextract)r   r   r   s      úu/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/opentelemetry/propagate/__init__.pyr   r   S   s   € ô$ Ó×'Ñ'¨°ÀÐ'ÓHÐHó    Úsetterc                 ó<   — t        «       j                  | ||¬«       y)aç  Uses the configured propagator to inject a Context into the carrier.

    Args:
        carrier: the medium used by Propagators to read
            values from and write values to.
            Should be paired with setter, which
            should know how to set header values on the carrier.
        context: An optional Context to use. Defaults to current
            context if not set.
        setter: An optional `Setter` object that can set values
            on the carrier.
    )r   r   N)r   Úinject)r   r   r   s      r   r   r   h   s   € ô" Ó×Ñ °ÀÐÕHr   Úpropagatorsztracecontext,baggageÚ,ÚnonezMOTEL_PROPAGATORS environment variable contains none, removing all propagatorsÚopentelemetry_propagator)ÚgroupÚnamezPropagator z5 not found. It is either misspelled or not installed.zFailed to load propagator: %sÚ_HTTP_TEXT_FORMATc                  ó   — t         S ©N©r   © r   r   r   r   ¦   s   € ÜÐr   Úhttp_text_formatc                 ó   — | a y r    r!   )r#   s    r   Úset_global_textmapr%   ª   s
   € ð )Ñr   )0Ú__doc__Úloggingr   Úosr   Útypingr   r   Úopentelemetry.context.contextr   Ú#opentelemetry.environment_variablesr   Úopentelemetry.propagatorsr	   r
   Ú&opentelemetry.util._importlib_metadatar   Ú__name__ÚloggerÚdefault_getterÚCarrierTÚGetterr   Údefault_setterÚSetterr   r   ÚTextMapPropagatorÚ__annotations__ÚgetÚenviron_propagatorsÚsplitÚ
propagatorÚstripÚlowerÚdebugÚappendÚnextÚiterÚloadÚStopIterationÚ
ValueErrorÚ	ExceptionÚ	exceptionÚCompositePropagatorr   r   r%   r"   r   r   Ú<module>rG      s6  ðò6õp Ý ß !å 1Ý @ß 8Ý ?á	�8Ó	€ð
 "&Ø/6×/EÑ/EñIØ×ÑðIà�gÑðIð �N‰N˜7×+Ñ+Ñ,ðIð ó	Ið. "&Ø/6×/EÑ/EñIØ×ÑðIà�gÑðIð �N‰N˜7×+Ñ+Ñ,ðIð 
ó	Ið( 02€ˆT�'×+Ñ+Ñ,Ó 1ð "�g—k‘kØØóÐ ð &×+Ñ+¨CÖ0€JØ×!Ñ!Ó#€JØ×ÑÓ˜VÒ#Ø�‰Ø[ô	
ð ˆÙðØ×Ñð‰DÙÙ Ø8Ø'ôóó÷ ‰d‹fóõ		
ð 1ð8 0M¨y×/LÑ/LØó0Ð �7×,Ñ,ó ð
˜G×5Ñ5ó ð)Ø×/Ñ/ð)à	ô)øð% ò 
ÙØ˜*˜Ð%ZÐ[ó
ð 	
ð ò Ø×ÑÐ8¸*ÔEØðús   Ä(8F&Æ&)G