o
    3Ih                     @   s:   d dl mZmZ d dlmZ d dlmZ G dd dZdS )    )OptionalUnion)Context)
Attributesc                	   @   s   e Zd ZdZ		ddeeef dedee	 ddfddZ
edeeef fd	d
ZedefddZedee	 fddZdedefddZdefddZdS )Observationa!  A measurement observed in an asynchronous instrument

    Return/yield instances of this class from asynchronous instrument callbacks.

    Args:
        value: The float or int measured value
        attributes: The measurement's attributes
        context: The measurement's context
    Nvalue
attributescontextreturnc                 C   s   || _ || _|| _d S N)_value_attributes_context)selfr   r   r	    r   k/home/air/sanwanet/gpt-api/venv/lib/python3.10/site-packages/opentelemetry/metrics/_internal/observation.py__init__    s   
zObservation.__init__c                 C      | j S r   )r   r   r   r   r   r   *      zObservation.valuec                 C   r   r   )r   r   r   r   r   r   .   r   zObservation.attributesc                 C   r   r   )r   r   r   r   r   r	   2   r   zObservation.contextotherc                 C   s.   t |to| j|jko| j|jko| j|jkS r   )
isinstancer   r   r   r	   )r   r   r   r   r   __eq__6   s   



zObservation.__eq__c                 C   s   d| j  d| j d| j dS )NzObservation(value=z, attributes=z
, context=))r   r   r	   r   r   r   r   __repr__>   s   zObservation.__repr__)NN)__name__
__module____qualname____doc__r   intfloatr   r   r   r   propertyr   r   r	   objectboolr   strr   r   r   r   r   r      s*    


r   N)typingr   r   opentelemetry.contextr   opentelemetry.util.typesr   r   r   r   r   r   <module>   s   