
    Xju                        U d Z ddlZddlmZmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZ ddlmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z* ddl+m,Z, ddl-m.Z. ddl/m0Z0  e
e1          Z2e$e&z  e%z  e'z  e(z  e)z  e*z  Z3 G d de          Z4 G d de4          Z5 G d de4          Z6e G d d                      Z7 G d de          Z8 G d de8          Z9 G d de8          Z: e,            Z;da<e4dz  e=d<    e6            Z>	 	 	 	 d*de?d e?d!e4dz  d"e?dz  d#e0dz  d$dfd%Z@d!e4d&eAd$dfd'ZBd!e4d$dfd(ZCd$e4fd)ZDdS )+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)Sequence)	dataclass)	getLogger)environ)Lock)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                   X    e Zd ZdZe	 	 	 d
dededz  dedz  dedz  ddf
d	            ZdS )MeterProviderz_
    MeterProvider is the entry point of the API. It provides access to `Meter` instances.
    Nnameversion
schema_url
attributesreturnMeterc                     dS )aF  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__`` should be avoided 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*   r+   s        e/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/opentelemetry/metrics/_internal/__init__.py	get_meterzMeterProvider.get_meter]             NNN)__name__
__module____qualname____doc__r   strr%   r3   r/   r5   r2   r'   r'   X   s           #!%(,! !! t! $J	!
 %! 
! ! ! ^! ! !r5   r'   c                   H    e Zd ZdZ	 	 	 d
dededz  dedz  dedz  ddf
d	ZdS )NoOpMeterProviderzQThe default MeterProvider used when no MeterProvider implementation is available.Nr(   r)   r*   r+   r,   r-   c                 &    t          |||          S )zReturns a NoOpMeter.r)   r*   )	NoOpMeterr0   s        r2   r3   zNoOpMeterProvider.get_meter   s     w:FFFFr5   r6   )r7   r8   r9   r:   r;   r%   r3   r/   r5   r2   r=   r=      s        [[
 #!%(,G GG tG $J	G
 %G 
G G G G G Gr5   r=   c                   \    e Zd ZddZ	 	 	 ddededz  dedz  dedz  ddf
d	Zd
eddfdZdS )_ProxyMeterProviderr,   Nc                 H    t                      | _        g | _        d | _        d S N)r	   _lock_meters_real_meter_providerr1   s    r2   __init__z_ProxyMeterProvider.__init__   s"    VV
*,:>!!!r5   r(   r)   r*   r+   r-   c                     | j         5  | j        (| j                            |||          cd d d            S t          |||          }| j                            |           |cd d d            S # 1 swxY w Y   d S Nr?   )rE   rG   r3   _ProxyMeterrF   append)r1   r(   r)   r*   r+   meters         r2   r3   z_ProxyMeterProvider.get_meter   s     Z 	 	(40::': 	 	 	 	 	 	 	 	  g*MMMEL&&&	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   #A2-A22A69A6meter_providerc                     | j         5  || _        | j        D ]}|                    |           	 d d d            d S # 1 swxY w Y   d S rD   )rE   rG   rF   on_set_meter_provider)r1   rO   rN   s      r2   rQ   z)_ProxyMeterProvider.on_set_meter_provider   s    Z 	< 	<(6D% < <++N;;;;<	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	< 	<s   '=AAr,   Nr6   )	r7   r8   r9   rI   r;   r%   r3   r'   rQ   r/   r5   r2   rB   rB      s        ? ? ? ? #!%(,  t $J	
 % 
   "<M <d < < < < < <r5   rB   c                   >    e Zd ZU eed<   eed<   eed<   edz  ed<   dS )_InstrumentRegistrationStatusinstrument_idalready_registeredconflictNcurrent_advisory)r7   r8   r9   r;   __annotations__boolr   r/   r5   r2   rT   rT      sD         NNN/$666666r5   rT   c                       e Zd ZdZ	 	 ddededz  dedz  ddf fdZedefd            Zededz  fd	            Zededz  fd
            Z		 ddede
dedededz  defdZededededededdfd            Ze	 	 d dedededefd            Ze	 	 d dedededefd            Ze	 	 	 d!dedee         dz  dededef
d            Ze	 	 d dddedededee         dz  def
d            Z	 	 d dedededefdZe	 	 	 d!dedee         dz  dededef
d            Ze	 	 	 d!dedee         dz  dedede f
d            Z! xZ"S )"r-   zHandles instrument creation.

    This class provides methods for creating instruments which are then
    used to produce measurements.
    Nr(   r)   r*   r,   c                     t                                                       || _        || _        || _        i | _        t                      | _        d S rD   )superrI   _name_version_schema_url_instrument_idsr	   _instrument_ids_lockr1   r(   r)   r*   	__class__s       r2   rI   zMeter.__init__   sK     	
%LN$(FF!!!r5   c                     | j         S )z7
        The name of the instrumenting module.
        )r^   rH   s    r2   r(   z
Meter.name   s    
 zr5   c                     | j         S )zB
        The version string of the instrumenting library.
        )r_   rH   s    r2   r)   zMeter.version   s    
 }r5   c                     | j         S )zC
        Specifies the Schema URL of the emitted telemetry
        )r`   rH   s    r2   r*   zMeter.schema_url   s    
 r5   type_unitdescriptionadvisoryc                 H   d                     |                                                                |j        ||g          }d}d}d}	| j        5  || j        v }|r| j        |         }	|	|k    }n
|| j        |<   ddd           n# 1 swxY w Y   t          ||||	          S )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)rU   rV   rW   rX   )joinstriplowerr7   rb   ra   rT   )
r1   r(   rh   ri   rj   rk   rU   rV   rW   rX   s
             r2   _register_instrumentzMeter._register_instrument   s   ( ZZ\\!!5>4E
 
 #& 	? 	?!.$2F!F! ?#'#7#F +x76>$]3	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? -'1-	
 
 
 	
s   *BB
B
instrumentation_typestatusc                 N    t                               d| ||||j                   d S )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warningrX   )r(   rr   ri   rj   rs   s        r2   %_log_instrument_registration_conflictz+Meter._log_instrument_registration_conflict  s>     	D  #		
 		
 		
 		
 		
r5    c                     dS )aR  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.
        Nr/   r1   r(   ri   rj   s       r2   create_counterzMeter.create_counter  r4   r5   c                     dS )aY  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.
        Nr/   rz   s       r2   create_up_down_counterzMeter.create_up_down_counter.  r4   r5   	callbacksc                     dS )a  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.
        Nr/   r1   r(   r~   ri   rj   s        r2   create_observable_counterzMeter.create_observable_counter>  r4   r5   #explicit_bucket_boundaries_advisoryr   c                    dS )ar  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.
        Nr/   )r1   r(   ri   rj   r   s        r2   create_histogramzMeter.create_histogram  r4   r5   c                 .    t          j        d           dS )aR  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warnrz   s       r2   create_gaugezMeter.create_gauge  s     	MNNNNNr5   c                     dS )aZ  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.
        Nr/   r   s        r2   create_observable_gaugezMeter.create_observable_gauge  r4   r5   c                     dS )ab  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.
        Nr/   r   s        r2   !create_observable_up_down_counterz'Meter.create_observable_up_down_counter  r4   r5   NNrD   rx   rx   Nrx   rx   )#r7   r8   r9   r:   r;   rI   propertyr(   r)   r*   typer   rT   rq   staticmethodrw   r   r   r{   r   r}   r   r   r   r   floatr   r   r   r   r   r   r   r   __classcell__rd   s   @r2   r-   r-      sk         #!%	+ ++ t+ $J	+
 
+ + + + + + c    X t    X  C$J       X  6:*
 *
*
 *
 	*

 *
 ,d2*
 
'*
 *
 *
 *
X 

!
 
 	

 .
 

 
 
 \
$  	   	
 
   ^  	   	
 
   ^  15^ ^^ I&-^ 	^
 ^ 
^ ^ ^ ^^@  	 GK    	 .6e_t-C 
   ^( 	O OO O 	O
 
O O O O   15  I&- 	
  
   ^&  15  I&- 	
  
!   ^    r5   r-   c                       e Zd Z	 	 ddededz  dedz  ddf fdZdeddfdZ	 	 dded
ededefdZ	 	 dded
edede	fdZ
	 	 	 ddedee         dz  d
ededef
dZ	 	 dddded
ededee         dz  def
dZ	 	 dded
ededefdZ	 	 	 ddedee         dz  d
ededef
dZ	 	 	 ddedee         dz  d
ededef
dZ xZS )rL   Nr(   r)   r*   r,   c                     t                                          |||           t                      | _        g | _        d | _        d S rK   )r]   rI   r	   rE   _instruments_real_meterrc   s       r2   rI   z_ProxyMeter.__init__  sE     	w:FFFVV
57)-r5   rO   c                     |                     | j        | j        | j                  }| j        5  || _        | j        D ]}|                    |           	 ddd           dS # 1 swxY w Y   dS )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)r3   r^   r_   r`   rE   r   r   on_meter_set)r1   rO   
real_meter
instruments       r2   rQ   z!_ProxyMeter.on_set_meter_provider  s     $--Jt'7
 

 Z 	4 	4)D #/ 4 4
''
33334		4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4s   'A##A'*A'rx   ri   rj   c                     | j         5  | j        r(| j                            |||          cd d d            S t          |||          }| j                            |           |cd d d            S # 1 swxY w Y   d S rD   )rE   r   r{   r   r   rM   r1   r(   ri   rj   proxys        r2   r{   z_ProxyMeter.create_counter  s     Z 	 	 P'66tT;OO	 	 	 	 	 	 	 	 "$k::E$$U+++	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	   #A1,A11A58A5c                     | j         5  | j        r(| j                            |||          cd d d            S t          |||          }| j                            |           |cd d d            S # 1 swxY w Y   d S rD   )rE   r   r}   r"   r   rM   r   s        r2   r}   z"_ProxyMeter.create_up_down_counter  s     Z 	 	 '>>$ 	 	 	 	 	 	 	 	
 (dK@@E$$U+++	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	r   r~   c                    | j         5  | j        r)| j                            ||||          cd d d            S t          ||||          }| j                            |           |cd d d            S # 1 swxY w Y   d S Nri   rj   )rE   r   r   r   r   rM   r1   r(   r~   ri   rj   r   s         r2   r   z%_ProxyMeter.create_observable_counter#  s     Z 		 		 'AA)T; 		 		 		 		 		 		 		 		
 ,id  E $$U+++		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		   $A4.A44A8;A8r   r   c                   | j         5  | j        r*| j                            ||||          cd d d            S t          ||||          }| j                            |           |cd d d            S # 1 swxY w Y   d S )Nr   )rE   r   r   r   r   rM   )r1   r(   ri   rj   r   r   s         r2   r   z_ProxyMeter.create_histogram5  s    Z 	 	 '888[	 9  	 	 	 	 	 	 	 	 $dK)L E $$U+++	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   %A4-A44A8;A8c                     | j         5  | j        r(| j                            |||          cd d d            S t          |||          }| j                            |           |cd d d            S # 1 swxY w Y   d S rD   )rE   r   r   r   r   rM   r   s        r2   r   z_ProxyMeter.create_gaugeK  s     Z 	 	 N'44T4MM	 	 	 	 	 	 	 	  dK88E$$U+++	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	r   c                    | j         5  | j        r)| j                            ||||          cd d d            S t          ||||          }| j                            |           |cd d d            S # 1 swxY w Y   d S r   )rE   r   r   r    r   rM   r   s         r2   r   z#_ProxyMeter.create_observable_gaugeX  s     Z 		 		 '??)T; 		 		 		 		 		 		 		 		
 *id  E $$U+++		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		r   c                    | j         5  | j        r)| j                            ||||          cd d d            S t          ||||          }| j                            |           |cd d d            S # 1 swxY w Y   d S r   )rE   r   r   r!   r   rM   r   s         r2   r   z-_ProxyMeter.create_observable_up_down_counterj  s     Z 	 	 'II	 	 	 	 	 	 	 	 	 2id  E $$U+++	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	r   r   r   r   )r7   r8   r9   r;   rI   r'   rQ   r   r{   r   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   s   @r2   rL   rL     s        #!%		. 	.	. t	. $J		.
 
	. 	. 	. 	. 	. 	.4M 4d 4 4 4 4( 	   	
 
     	   	
 
   $ 15  I&- 	
  
   * 	 GK    	 .6e_t-C 
   2 	   	
 
     15  I&- 	
  
   * 15  I&- 	
  
!       r5   rL   c                   H   e Zd ZdZ	 	 ddedededefdZ	 	 ddedededefdZ	 	 ddededede	fd	Z
	 	 	 ddedee         d
z  dededef
dZ	 	 dd
ddedededee         d
z  def
dZ	 	 	 ddedee         d
z  dededef
dZ	 	 	 ddedee         d
z  dededef
dZd
S )r@   zeThe default Meter used when no Meter implementation is available.

    All operations are no-op.
    rx   r(   ri   rj   r,   c                     |                      |t          ||          }|j        r#|                     |t          j        |||           t          |||          S )zReturns a no-op Counter.r   )rq   r   rW   rw   r   r7   r1   r(   ri   rj   rs   s        r2   r{   zNoOpMeter.create_counter  so     **+t[
 
 ? 	66    4dDDDDr5   c                     |                      |t          ||          }|j        r#|                     |t          j        |||           t          |||          S )zReturns a no-op Gauge.r   )rq   r   rW   rw   r   r7   r   s        r2   r   zNoOpMeter.create_gauge  sg     **4D+NN? 	66   DkBBBBr5   c                     |                      |t          ||          }|j        r#|                     |t          j        |||           t          |||          S )zReturns a no-op UpDownCounter.r   )rq   r   rW   rw   r   r7   r   s        r2   r}   z NoOpMeter.create_up_down_counter  sp     **#T;
 
 ? 	66&   !DkJJJJr5   Nr~   c                     |                      |t          ||          }|j        r#|                     |t          j        |||           t          ||||          S )z"Returns a no-op ObservableCounter.r   )rq   r   rW   rw   r   r7   r1   r(   r~   ri   rj   rs   s         r2   r   z#NoOpMeter.create_observable_counter  s~     **'{
 
 ? 	66!*   %#	
 
 
 	
r5   r   r   c          	          |                      |t          ||t          |                    }|j        r#|                     |t
          j        |||           t          ||||          S )zReturns a no-op Histogram.)explicit_bucket_boundaries)ri   rj   r   )rq   r   r   rW   rw   r   r7   )r1   r(   ri   rj   r   rs   s         r2   r   zNoOpMeter.create_histogram  s     **%+N  
 
 ? 	66"   #0S	
 
 
 	
r5   c                     |                      |t          ||          }|j        r#|                     |t          j        |||           t          ||||          S )z Returns a no-op ObservableGauge.r   )rq   r   rW   rw   r   r7   r   s         r2   r   z!NoOpMeter.create_observable_gauge  s~     **%t[
 
 ? 	66(   ##	
 
 
 	
r5   c                     |                      |t          ||          }|j        r#|                     |t          j        |||           t          ||||          S )z(Returns a no-op ObservableUpDownCounter.r   )rq   r   rW   rw   r   r7   r   s         r2   r   z+NoOpMeter.create_observable_up_down_counter  s~     **-t[
 
 ? 	66'0   +#	
 
 
 	
r5   r   r   )r7   r8   r9   r:   r;   r   r{   r   r   r   r}   r   r   r   r   r   r   r   r   r   r   r   r/   r5   r2   r@   r@     s         	E EE E 	E
 
E E E E0 	C CC C 	C
 
C C C C* 	K KK K 	K
 
K K K K. 15
 

 I&-
 	

 
 

 
 
 
: 	
 GK
 
 

 
 	
 .6e_t-C
 

 
 
 
H 15
 

 I&-
 	

 
 

 
 
 
: 15
 

 I&-
 	

 
 
!
 
 
 
 
 
r5   r@   _METER_PROVIDERrx   r(   r)   rO   r*   r+   r,   c                 R    |t                      }|                    | |||          S )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_providerr3   )r(   r)   rO   r*   r+   s        r2   r3   r3   6  s/     +--##D':zJJJr5   logc                      d fd}t                               |          }|r|st                              d           d S d S d S )Nr,   c                  @     a t                                          d S rD   )r   _PROXY_METER_PROVIDERrQ   rO   s   r2   set_mpz#_set_meter_provider.<locals>.set_mpJ  s$    ( 	33NCCCCCr5   z2Overriding of current MeterProvider is not allowedrR   )_METER_PROVIDER_SET_ONCEdo_onceru   rv   )rO   r   r   did_sets   `   r2   _set_meter_providerr   I  s~    D D D D D D '..v66G
 N7 NLMMMMMN N N Nr5   c                 (    t          | d           dS )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    r2   set_meter_providerr   W  s     D111111r5   c                      t           ;t          t          vrt          S t	          t          d          } t          | d           t          dt                     S )z8Gets the current global :class:`~.MeterProvider` object.NrO   Fr   r'   )r   r   r   r   r$   r   r
   r   s    r2   r   r   `  sW     %W44(((6&(8)
 )
 	N6666 111r5   )rx   NNN)Er:   r   abcr   r   collections.abcr   dataclassesr   loggingr   osr   	threadingr	   typingr
   #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%   r7   ru   _ProxyInstrumentTr'   r=   rB   rT   r-   rL   r@   r   r   rY   r   r;   r3   rZ   r   r   r   r/   r5   r2   <module>r      s    4  # # # # # # # # $ $ $ $ $ $ ! ! ! ! ! !                         J J J J J J                                                 2 * ) ) ) ) ) 8 8 8 8 8 8      )H


   	
 $$  ' ' ' ' 'C ' ' 'TG G G G G G G G< < < < <- < < << 7 7 7 7 7 7 7 7q q q q qC q q qh	S S S S S% S S Sln
 n
 n
 n
 n
 n
 n
 n
b  466 (,% , , ,++-- 
 +/!$(K K
KK "D(K d
	K
 T!K K K K K&N ND NT N N N N2} 2 2 2 2 22M 2 2 2 2 2 2r5   