
    Xjp                         d dl mZmZmZ d dlmZ d dlmZmZ dZ	 ed          Z
ddededz  defd	Zddedz  defd
ZdS )    )
create_key	get_value	set_value)Context)INVALID_SPANSpanzcurrent-spanNspancontextreturnc                 4    t          t          | |          }|S )zSet the span in the given context.

    Args:
        span: The Span to set.
        context: a Context object. if one is not passed, the
            default current context is used instead.
    r
   )r   	_SPAN_KEY)r	   r
   ctxs      e/var/www/FlaskApp/flask-venv/lib/python3.11/site-packages/opentelemetry/trace/propagation/__init__.pyset_span_in_contextr      s     ItW
5
5
5CJ    c                 n    t          t          |           }|t          |t                    st          S |S )zRetrieve the current span.

    Args:
        context: A Context object. If one is not passed, the
            default current context is used instead.

    Returns:
        The Span set in the context if it exists. INVALID_SPAN otherwise.
    r   )r   r   
isinstancer   r   )r
   r	   s     r   get_current_spanr      s4     Y000D|:dD11|Kr   )N)opentelemetry.contextr   r   r   opentelemetry.context.contextr   opentelemetry.trace.spanr   r   SPAN_KEYr   r   r    r   r   <module>r      s    C B B B B B B B B B 1 1 1 1 1 1 7 7 7 7 7 7 7 7J~&&		 	d 	Wt^ 	w 	 	 	 	 gn       r   