
    2ix                     v   % S r SSKrSSKJrJr  SSKJr  SSKJr  SSK	J
r
  SSKJr  SSKJrJrJrJrJrJr  SS	KJr  SS
KJrJrJrJrJrJrJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-  SSK.J/r/  SSK0J1r1  SSK2J3r3  \" \45      r5\\'\)\(\*\+\,\-4   r6 " S S\5      r7 " S S\75      r8 " S S\75      r9\ " S S5      5       r: " S S\5      r; " S S\;5      r< " S S\;5      r=\/" 5       r>Sq?\\7   \@S'   \9" 5       rA    S(S\BS\BS\\7   S \\B   S!\\3   S"S4S# jjrCS\7S$\DS"S4S% jrES\7S"S4S& jrFS"\74S' jrGg))a  
The OpenTelemetry metrics API  describes the classes used to generate
metrics.

The :class:`.MeterProvider` provides users access to the :class:`.Meter` which in
turn is used to create :class:`.Instrument` objects. The :class:`.Instrument` objects are
used to record measurements.

This module provides abstract (i.e. unimplemented) classes required for
metrics, and a concrete no-op implementation :class:`.NoOpMeter` that allows applications
to use the API package alone without a supporting implementation.

To get a meter, you need to provide the package name from which you are
calling the meter APIs to OpenTelemetry by calling `MeterProvider.get_meter`
with the calling instrumentation name and the version of your package.

The following code shows how to obtain a meter using the global :class:`.MeterProvider`::

    from opentelemetry.metrics import get_meter

    meter = get_meter("example-meter")
    counter = meter.create_counter("example-counter")

.. versionadded:: 1.10.0
    N)ABCabstractmethod)	dataclass)	getLogger)environ)Lock)DictListOptionalSequenceUnioncast)OTEL_PYTHON_METER_PROVIDER)	CallbackTCounterGauge	HistogramNoOpCounter	NoOpGaugeNoOpHistogramNoOpObservableCounterNoOpObservableGaugeNoOpObservableUpDownCounterNoOpUpDownCounterObservableCounterObservableGaugeObservableUpDownCounterUpDownCounter_MetricsHistogramAdvisory_ProxyCounter_ProxyGauge_ProxyHistogram_ProxyObservableCounter_ProxyObservableGauge_ProxyObservableUpDownCounter_ProxyUpDownCounter)Once)_load_provider)
Attributesc                   \    \ rS rSrSr\   SS\S\\   S\\   S\\   SS	4
S
 jj5       r	Sr
g)MeterProviderb   zW
MeterProvider is the entry point of the API. It provides access to `Meter` instances.
Nnameversion
schema_url
attributesreturnMeterc                     g)a  Returns a `Meter` for use by the given instrumentation library.

For any two calls it is undefined whether the same or different
`Meter` instances are returned, even for different library names.

This function may return different `Meter` types (e.g. a no-op meter
vs. a functional meter).

Args:
    name: The name of the instrumenting module.
        ``__name__`` may not be used as this can result in
        different meter names if the meters are in different files.
        It is better to use a fixed string that can be imported where
        needed and used consistently as the name of the meter.

        This should *not* be the name of the module that is
        instrumented but the name of the module doing the instrumentation.
        E.g., instead of ``"requests"``, use
        ``"opentelemetry.instrumentation.requests"``.

    version: Optional. The version string of the
        instrumenting library.  Usually this should be the same as
        ``importlib.metadata.version(instrumenting_library_name)``.

    schema_url: Optional. Specifies the Schema URL of the emitted telemetry.
    attributes: Optional. Attributes that are associated with the emitted telemetry.
N selfr-   r.   r/   r0   s        b/home/james-whalen/.local/lib/python3.13/site-packages/opentelemetry/metrics/_internal/__init__.py	get_meterMeterProvider.get_meterg           r4   NNN)__name__
__module____qualname____firstlineno____doc__r   strr   r)   r8   __static_attributes__r4   r;   r7   r+   r+   b   sc      "&$(+/!! #! SM	!
 Z(! 
! !r;   r+   c                   R    \ rS rSrSr   SS\S\\   S\\   S\\   SS	4
S
 jjrSr	g)NoOpMeterProvider   zQThe default MeterProvider used when no MeterProvider implementation is available.Nr-   r.   r/   r0   r1   r2   c                     [        XUS9$ )zReturns a NoOpMeter.r.   r/   )	NoOpMeterr5   s        r7   r8   NoOpMeterProvider.get_meter   s     :FFr;   r4   r<   )
r=   r>   r?   r@   rA   rB   r   r)   r8   rC   r4   r;   r7   rE   rE      s^    [
 "&$(+/GG #G SM	G
 Z(G 
G Gr;   rE   c                   j    \ rS rSrSS jr   SS\S\\   S\\   S\\   SS	4
S
 jjrS\	SS4S jr
Srg)_ProxyMeterProvider   r1   Nc                 >    [        5       U l        / U l        S U l        g N)r   _lock_meters_real_meter_providerr6   s    r7   __init___ProxyMeterProvider.__init__   s    V
*,=A!r;   r-   r.   r/   r0   r2   c                    U R                      U R                  b%  U R                  R                  XU5      sS S S 5        $ [        XUS9nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = fNrH   )rP   rR   r8   _ProxyMeterrQ   append)r6   r-   r.   r/   r0   meters         r7   r8   _ProxyMeterProvider.get_meter   sd     ZZ((400::: Z  *MELL& ZZs   )A0 &A00
A>meter_providerc                     U R                      Xl        U R                   H  nUR                  U5        M     S S S 5        g ! , (       d  f       g = frO   )rP   rR   rQ   on_set_meter_provider)r6   r\   rZ   s      r7   r^   )_ProxyMeterProvider.on_set_meter_provider   s5    ZZ(6%++N; & ZZs   +A
A)rP   rQ   rR   r1   Nr<   )r=   r>   r?   r@   rT   rB   r   r)   r8   r+   r^   rC   r4   r;   r7   rL   rL      sh    B "&$(+/ # SM	
 Z( 
"<M <d <r;   rL   c                   D    \ rS rSr% \\S'   \\S'   \\S'   \\   \S'   Sr	g)_InstrumentRegistrationStatus   instrument_idalready_registeredconflictcurrent_advisoryr4   N)
r=   r>   r?   r@   rB   __annotations__boolr   r   rC   r4   r;   r7   rb   rb      s    N899r;   rb   c                   z  ^  \ rS rSrSr  SS\S\\   S\\   SS4U 4S jjjr\S\4S	 j5       r	\S\\   4S
 j5       r
\S\\   4S j5       r S S\S\S\S\S\\   S\4S jjr\S\S\S\S\S\SS4S j5       r\  S!S\S\S\S\4S jj5       r\  S!S\S\S\S\4S jj5       r\   S"S\S\\\      S\S\S\4
S jj5       r\  S!SS.S\S\S\S\\\      S\4
S jjj5       r  S!S\S\S\S\4S jjr\   S"S\S\\\      S\S\S\ 4
S jj5       r!\   S"S\S\\\      S\S\S\"4
S jj5       r#Sr$U =r%$ )#r2      zHandles instrument creation.

This class provides methods for creating instruments which are then
used to produce measurements.
Nr-   r.   r/   r1   c                 r   > [         TU ]  5         Xl        X l        X0l        0 U l        [        5       U l        g rO   )superrT   _name_version_schema_url_instrument_idsr   _instrument_ids_lockr6   r-   r.   r/   	__class__s       r7   rT   Meter.__init__   s9     	
%  	 %)F!r;   c                     U R                   $ )z'
The name of the instrumenting module.
)rn   rS   s    r7   r-   
Meter.name   s    
 zzr;   c                     U R                   $ )z2
The version string of the instrumenting library.
)ro   rS   s    r7   r.   Meter.version   s    
 }}r;   c                     U R                   $ )z3
Specifies the Schema URL of the emitted telemetry
)rp   rS   s    r7   r/   Meter.schema_url   s    
 r;   type_unitdescriptionadvisoryc                 T   SR                  UR                  5       R                  5       UR                  X4/5      nSnSnSn	U R                     X`R
                  ;   nU(       a  U R
                  U   n	X:g  nOXPR
                  U'   SSS5        [        UUUU	S9$ ! , (       d  f       N= f)a  
Register an instrument with the name, type, unit and description as
identifying keys and the advisory as value.

Returns a tuple. The first value is the instrument id.
The second value is an `_InstrumentRegistrationStatus` where
`already_registered` is `True` if the instrument has been registered
already.
If `conflict` is set to True the `current_advisory` attribute contains
the registered instrument advisory.
,FN)rd   re   rf   rg   )joinstriplowerr=   rr   rq   rb   )
r6   r-   r|   r}   r~   r   rd   re   rf   rg   s
             r7   _register_instrumentMeter._register_instrument   s    ( ZZ\!5>>4E
 #&&!.2F2F!F!#'#7#7#F +76>$$]3 ' -'1-	
 	
 '&s   8B
B'instrumentation_typestatusc                 L    [         R                  SU UUUUR                  5        g )NzAn instrument with name %s, type %s, unit %s and description %s has been created already with a different advisory value %s and will be used instead.)_loggerwarningrg   )r-   r   r}   r~   r   s        r7   %_log_instrument_registration_conflict+Meter._log_instrument_registration_conflict  s-     	D  ##		
r;   c                     g)a"  Creates a `Counter` instrument

Args:
    name: The name of the instrument to be created
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
Nr4   r6   r-   r}   r~   s       r7   create_counterMeter.create_counter*  r:   r;   c                     g)a)  Creates an `UpDownCounter` instrument

Args:
    name: The name of the instrument to be created
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
Nr4   r   s       r7   create_up_down_counterMeter.create_up_down_counter:  r:   r;   	callbacksc                     g)a9  Creates an `ObservableCounter` instrument

An observable counter observes a monotonically increasing count by calling provided
callbacks which accept a :class:`~opentelemetry.metrics.CallbackOptions` and return
multiple :class:`~opentelemetry.metrics.Observation`.

For example, an observable counter could be used to report system CPU
time periodically. Here is a basic implementation::

    def cpu_time_callback(options: CallbackOptions) -> Iterable[Observation]:
        observations = []
        with open("/proc/stat") as procstat:
            procstat.readline()  # skip the first line
            for line in procstat:
                if not line.startswith("cpu"): break
                cpu, *states = line.split()
                observations.append(Observation(int(states[0]) // 100, {"cpu": cpu, "state": "user"}))
                observations.append(Observation(int(states[1]) // 100, {"cpu": cpu, "state": "nice"}))
                observations.append(Observation(int(states[2]) // 100, {"cpu": cpu, "state": "system"}))
                # ... other states
        return observations

    meter.create_observable_counter(
        "system.cpu.time",
        callbacks=[cpu_time_callback],
        unit="s",
        description="CPU time"
    )

To reduce memory usage, you can use generator callbacks instead of
building the full list::

    def cpu_time_callback(options: CallbackOptions) -> Iterable[Observation]:
        with open("/proc/stat") as procstat:
            procstat.readline()  # skip the first line
            for line in procstat:
                if not line.startswith("cpu"): break
                cpu, *states = line.split()
                yield Observation(int(states[0]) // 100, {"cpu": cpu, "state": "user"})
                yield Observation(int(states[1]) // 100, {"cpu": cpu, "state": "nice"})
                # ... other states

Alternatively, you can pass a sequence of generators directly instead of a sequence of
callbacks, which each should return iterables of :class:`~opentelemetry.metrics.Observation`::

    def cpu_time_callback(states_to_include: set[str]) -> Iterable[Iterable[Observation]]:
        # accept options sent in from OpenTelemetry
        options = yield
        while True:
            observations = []
            with open("/proc/stat") as procstat:
                procstat.readline()  # skip the first line
                for line in procstat:
                    if not line.startswith("cpu"): break
                    cpu, *states = line.split()
                    if "user" in states_to_include:
                        observations.append(Observation(int(states[0]) // 100, {"cpu": cpu, "state": "user"}))
                    if "nice" in states_to_include:
                        observations.append(Observation(int(states[1]) // 100, {"cpu": cpu, "state": "nice"}))
                    # ... other states
            # yield the observations and receive the options for next iteration
            options = yield observations

    meter.create_observable_counter(
        "system.cpu.time",
        callbacks=[cpu_time_callback({"user", "system"})],
        unit="s",
        description="CPU time"
    )

The :class:`~opentelemetry.metrics.CallbackOptions` contain a timeout which the
callback should respect. For example if the callback does asynchronous work, like
making HTTP requests, it should respect the timeout::

    def scrape_http_callback(options: CallbackOptions) -> Iterable[Observation]:
        r = requests.get('http://scrapethis.com', timeout=options.timeout_millis / 10**3)
        for value in r.json():
            yield Observation(value)

Args:
    name: The name of the instrument to be created
    callbacks: A sequence of callbacks that return an iterable of
        :class:`~opentelemetry.metrics.Observation`. Alternatively, can be a sequence of generators that each
        yields iterables of :class:`~opentelemetry.metrics.Observation`.
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
Nr4   r6   r-   r   r}   r~   s        r7   create_observable_counterMeter.create_observable_counterJ  r:   r;   #explicit_bucket_boundaries_advisoryr   c                    g)aB  Creates a :class:`~opentelemetry.metrics.Histogram` instrument

Args:
    name: The name of the instrument to be created
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
Nr4   )r6   r-   r}   r~   r   s        r7   create_histogramMeter.create_histogram  r:   r;   c                 0    [         R                  " S5        g)a"  Creates a ``Gauge`` instrument

Args:
    name: The name of the instrument to be created
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
z5create_gauge() is not implemented and will be a no-opN)warningswarnr   s       r7   create_gaugeMeter.create_gauge  s     	MNr;   c                     g)a  Creates an `ObservableGauge` instrument

Args:
    name: The name of the instrument to be created
    callbacks: A sequence of callbacks that return an iterable of
        :class:`~opentelemetry.metrics.Observation`. Alternatively, can be a generator that yields iterables
        of :class:`~opentelemetry.metrics.Observation`.
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
Nr4   r   s        r7   create_observable_gaugeMeter.create_observable_gauge  r:   r;   c                     g)a  Creates an `ObservableUpDownCounter` instrument

Args:
    name: The name of the instrument to be created
    callbacks: A sequence of callbacks that return an iterable of
        :class:`~opentelemetry.metrics.Observation`. Alternatively, can be a generator that yields iterables
        of :class:`~opentelemetry.metrics.Observation`.
    unit: The unit for observations this instrument reports. For
        example, ``By`` for bytes. UCUM units are recommended.
    description: A description for this instrument and what it measures.
Nr4   r   s        r7   !create_observable_up_down_counter'Meter.create_observable_up_down_counter  r:   r;   )rq   rr   rn   rp   ro   NNrO    r   Nr   r   )&r=   r>   r?   r@   rA   rB   r   rT   propertyr-   r.   r/   typer   rb   r   staticmethodr   r   r   r   r   r   r   r   r   r   floatr   r   r   r   r   r   r   r   rC   __classcell__rt   s   @r7   r2   r2      sh    "&$(	++ #+ SM	+
 
+ + c   #    HSM     9=*
*
 *
 	*

 *
 45*
 
'*
X 

!
 
 	

 .
 

 
$  	  	
 
   	  	
 
   48^^ HY/0^ 	^
 ^ 
^ ^@  	 JN  	 .6huo-F 
 ( 	OO O 	O
 
O   48 HY/0 	
  
 &  48 HY/0 	
  
! r;   r2   c                     ^  \ rS rSr  SS\S\\   S\\   SS4U 4S jjjrS\SS4S	 jr  SS\S
\S\S\	4S jjr
  SS\S
\S\S\4S jjr   SS\S\\\      S
\S\S\4
S jjr  SSS.S\S
\S\S\\\      S\4
S jjjr  SS\S
\S\S\4S jjr   SS\S\\\      S
\S\S\4
S jjr   SS\S\\\      S
\S\S\4
S jjrSrU =r$ )rX   i  Nr-   r.   r/   r1   c                 \   > [         TU ]  XUS9  [        5       U l        / U l        S U l        g rW   )rm   rT   r   rP   _instruments_real_meterrs   s       r7   rT   _ProxyMeter.__init__  s0     	:FV
57,0r;   r\   c                    UR                  U R                  U R                  U R                  5      nU R                     X l        U R                   H  nUR                  U5        M     SSS5        g! , (       d  f       g= f)zCalled when a real meter provider is set on the creating _ProxyMeterProvider

Creates a real backing meter for this instance and notifies all created
instruments so they can create real backing instruments.
N)r8   rn   ro   rp   rP   r   r   on_meter_set)r6   r\   
real_meter
instruments       r7   r^   !_ProxyMeter.on_set_meter_provider  sb     $--JJt'7'7

 ZZ) #//
''
3 0	 ZZs   +A22
B r}   r~   c                    U R                      U R                  (       a%  U R                  R                  XU5      sS S S 5        $ [        XU5      nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = frO   )rP   r   r   r    r   rY   r6   r-   r}   r~   proxys        r7   r   _ProxyMeter.create_counter  s`     ZZ''66t;O Z "$k:E$$U+ ZZ   -A6(A66
Bc                    U R                      U R                  (       a%  U R                  R                  XU5      sS S S 5        $ [        XU5      nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = frO   )rP   r   r   r&   r   rY   r   s        r7   r   "_ProxyMeter.create_up_down_counter   sc     ZZ''>> Z
 (K@E$$U+ ZZr   r   c                 
   U R                      U R                  (       a%  U R                  R                  XX45      sS S S 5        $ [        XX4S9nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = fNr}   r~   )rP   r   r   r#   r   rY   r6   r-   r   r}   r~   r   s         r7   r   %_ProxyMeter.create_observable_counter/  sh     ZZ''AAT Z
 ,dE $$U+ ZZ   -A4&A44
Br   r   c                   U R                      U R                  (       a%  U R                  R                  UUUUS9sS S S 5        $ [        XX45      nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = f)Nr   )rP   r   r   r"   r   rY   )r6   r-   r}   r~   r   r   s         r7   r   _ProxyMeter.create_histogramA  st     ZZ''888[	 9  Z $KE $$U+ ZZr   c                    U R                      U R                  (       a%  U R                  R                  XU5      sS S S 5        $ [        XU5      nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = frO   )rP   r   r   r!   r   rY   r   s        r7   r   _ProxyMeter.create_gaugeW  s`     ZZ''44TM Z  K8E$$U+ ZZr   c                 
   U R                      U R                  (       a%  U R                  R                  XX45      sS S S 5        $ [        XX4S9nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = fr   )rP   r   r   r$   r   rY   r   s         r7   r   #_ProxyMeter.create_observable_gauged  sh     ZZ''??T Z
 *dE $$U+ ZZr   c                    U R                      U R                  (       a'  U R                  R                  UUUU5      sS S S 5        $ [        XX4S9nU R                  R                  U5        UsS S S 5        $ ! , (       d  f       g = fr   )rP   r   r   r%   r   rY   r   s         r7   r   -_ProxyMeter.create_observable_up_down_counterv  so     ZZ''II	 Z 2dE $$U+ ZZs   /A6&A66
B)r   rP   r   r   r   r   )r=   r>   r?   r@   rB   r   rT   r+   r^   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rC   r   r   s   @r7   rX   rX     s$    "&$(		1	1 #	1 SM		1
 
	1 	14M 4d 4( 	  	
 
  	  	
 
$ 48 HY/0 	
  
* 	 JN  	 .6huo-F 
2 	  	
 
  48 HY/0 	
  
* 48 HY/0 	
  
! r;   rX   c                   T   \ rS rSrSr  SS\S\S\S\4S jjr  SS\S\S\S\4S jjr	  SS\S\S\S\
4S	 jjr   SS\S\\\      S\S\S\4
S jjr  SS
S.S\S\S\S\\\      S\4
S jjjr   SS\S\\\      S\S\S\4
S jjr   SS\S\\\      S\S\S\4
S jjrSrg
)rI   i  z]The default Meter used when no Meter implementation is available.

All operations are no-op.
r-   r}   r~   r1   c                     U R                  U[        X#5      nUR                  (       a#  U R                  U[        R
                  UUU5        [        XUS9$ )zReturns a no-op Counter.r   )r   r   rf   r   r   r=   r6   r-   r}   r~   r   s        r7   r   NoOpMeter.create_counter  sV     **+t
 ??66   4DDr;   c                     U R                  U[        X#5      nUR                  (       a#  U R                  U[        R
                  UUU5        [        XUS9$ )zReturns a no-op Gauge.r   )r   r   rf   r   r   r=   r   s        r7   r   NoOpMeter.create_gauge  sO     **4DN??66 kBBr;   c                     U R                  U[        X#5      nUR                  (       a#  U R                  U[        R
                  UUU5        [        XUS9$ )zReturns a no-op UpDownCounter.r   )r   r   rf   r   r   r=   r   s        r7   r    NoOpMeter.create_up_down_counter  sW     **#T
 ??66&& !kJJr;   Nr   c                     U R                  U[        X45      nUR                  (       a#  U R                  U[        R
                  UUU5        [        UUUUS9$ )z"Returns a no-op ObservableCounter.r   )r   r   rf   r   r   r=   r6   r-   r   r}   r~   r   s         r7   r   #NoOpMeter.create_observable_counter  sc     **'
 ??66!** %#	
 	
r;   r   r   c          
          U R                  U[        UU[        US95      nUR                  (       a#  U R	                  U[
        R                  UUU5        [        UUUUS9$ )zReturns a no-op Histogram.)explicit_bucket_boundaries)r}   r~   r   )r   r   r   rf   r   r   r=   )r6   r-   r}   r~   r   r   s         r7   r   NoOpMeter.create_histogram  sr     **%+N
 ??66"" #0S	
 	
r;   c                     U R                  U[        X45      nUR                  (       a#  U R                  U[        R
                  UUU5        [        UUUUS9$ )z Returns a no-op ObservableGauge.r   )r   r   rf   r   r   r=   r   s         r7   r   !NoOpMeter.create_observable_gauge  sc     **%t
 ??66(( ##	
 	
r;   c                     U R                  U[        X45      nUR                  (       a#  U R                  U[        R
                  UUU5        [        UUUUS9$ )z(Returns a no-op ObservableUpDownCounter.r   )r   r   rf   r   r   r=   r   s         r7   r   +NoOpMeter.create_observable_up_down_counter"  sc     **-t
 ??66'00 +#	
 	
r;   r4   r   r   )r=   r>   r?   r@   rA   rB   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rC   r4   r;   r7   rI   rI     s    	EE E 	E
 
E0 	CC C 	C
 
C* 	KK K 	K
 
K. 48

 HY/0
 	

 
 

: 	
 JN

 
 	
 .6huo-F
 

H 48

 HY/0
 	

 
 

: 48

 HY/0
 	

 
 
!
 
r;   rI   _METER_PROVIDERr-   r.   r\   r/   r0   r1   c                 @    Uc
  [        5       nUR                  XX45      $ )zReturns a `Meter` for use by the given instrumentation library.

This function is a convenience wrapper for
`opentelemetry.metrics.MeterProvider.get_meter`.

If meter_provider is omitted the current configured one is used.
)get_meter_providerr8   )r-   r.   r\   r/   r0   s        r7   r8   r8   B  s%     +-##D:JJr;   logc                    ^  SU 4S jjn[         R                  U5      nU(       a  U(       d  [        R                  S5        g g g )Nc                  4   > T q [        R                  T 5        g rO   )r   _PROXY_METER_PROVIDERr^   r\   s   r7   set_mp#_set_meter_provider.<locals>.set_mpV  s    ( 	33NCr;   z2Overriding of current MeterProvider is not allowedr`   )_METER_PROVIDER_SET_ONCEdo_oncer   r   )r\   r   r   did_sets   `   r7   _set_meter_providerr   U  s4    D '..v6G
7LM sr;   c                     [        U SS9  g)zSets the current global :class:`~.MeterProvider` object.

This can only be done once, a warning will be logged if any further attempt
is made.
Tr   N)r   r   s    r7   set_meter_providerr   c  s     D1r;   c                      [         c.  [        [        ;  a  [        $ [	        [        S5      n [        U SS9  [        S[         5      $ )z8Gets the current global :class:`~.MeterProvider` object.r\   Fr   r+   )r   r   r   r   r(   r   r   r   s    r7   r   r   l  sC     %W4(((6&(8)
 	N6 11r;   )r   NNN)HrA   r   abcr   r   dataclassesr   loggingr   osr   	threadingr   typingr	   r
   r   r   r   r   #opentelemetry.environment_variablesr   *opentelemetry.metrics._internal.instrumentr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   opentelemetry.util._oncer'   opentelemetry.util._providersr(   opentelemetry.util.typesr)   r=   r   _ProxyInstrumentTr+   rE   rL   rb   r2   rX   rI   r   r   rh   r   rB   r8   ri   r   r   r   r4   r;   r7   <module>r     s  "4  # !    > > J      2 * 8 H
 ! 'C 'TG G<- << : : :sC sl	S% Sln
 n
b  6 +/-( /+- 
 .2 $'+K
KK ]+K 	K
 $K K&N ND NT N2} 2 22M 2r;   