File: //proc/thread-self/root/var/opt/nydus/ops/mysql/opentelemetry/trace/__pycache__/span.cpython-39.pyc
a
�,�h1H �
@ s� d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlm Z m
Z
d dlmZ dZe�
e�ZdZe�
e�ZdZe�
d�Ze�
d e� d
e� d��Ze�e�Zeeed�d
d�ZG dd� de j�ZG dd� de�Ze�� ZG dd� dej eef �Z!e!�� Z"dd d Z#dZ$G dd� dej%eeeddef �Z&G dd� de�Z'd Z(d Z)e&e)e(dee"d�Z*e'e*�Z+eed�d d!�Z,eed"�d#d$�Z-dS )%� N)�OrderedDict)�Status�
StatusCode)�typeszU[a-z][_0-9a-z\-\*\/]{0,255}|[a-z0-9][_0-9a-z\-\*\/]{0,240}@[a-z][_0-9a-z\-\*\/]{0,13}zA[\x20-\x2b\x2d-\x3c\x3e-\x7e]{0,255}[\x21-\x2b\x2d-\x3c\x3e-\x7e]� z
[ \t]*,[ \t]*�(z)(=)(z)[ ]*��key�value�returnc C s0 t | t�o.t�| �d uo.t |t�o.t�|�d uS �N)�
isinstance�str�_KEY_PATTERN� fullmatch�_VALUE_PATTERN)r r
� r �Q/opt/nydus/tmp/pip-target-wkfpz8uv/lib64/python/mysql/opentelemetry/trace/span.py�_is_valid_pair. s
���r c @ sX e Zd ZdZejd$eje dd�dd��Z ejdd�dd ��Z
ejejee
jf dd
�dd��Zejee
jdd
�dd��Zejd%ee
jeje dd�dd��Zejedd�dd��Zejed�dd��Zejd&ejeef eje dd�dd��Zejd'ee
jeje edd�dd��Zd d�dd �Zejeje eje ejej dd!�d"d#�Z!dS )(�Spanz4A span represents a single operation within a trace.N��end_timer c C s dS )a
Sets the current time as the span's end time.
The span's end time is the wall time at which the operation finished.
Only the first call to `end` should modify the span, and
implementations are free to ignore or raise on further calls.
Nr ��selfr r r r �end: s zSpan.end�SpanContext�r c C s dS )a Gets the span's SpanContext.
Get an immutable, serializable identifier for this span that can be
used to create new child spans.
Returns:
A :class:`opentelemetry.trace.SpanContext` with a copy of this span's immutable state.
Nr �r r r r �get_span_contextD s zSpan.get_span_context��
attributesr c C s dS )a� Sets Attributes.
Sets Attributes with the key and value passed as arguments dict.
Note: The behavior of `None` value attributes is undefined, and hence
strongly discouraged. It is also preferred to set attributes at span
creation, instead of calling this method later since samplers can only
consider information already present during span creation.
Nr �r r r r r �set_attributesO s zSpan.set_attributesr c C s dS )a� Sets an Attribute.
Sets a single Attribute with the key and value passed as arguments.
Note: The behavior of `None` value attributes is undefined, and hence
strongly discouraged. It is also preferred to set attributes at span
creation, instead of calling this method later since samplers can only
consider information already present during span creation.
Nr �r r r
r r r �
set_attribute] s zSpan.set_attribute��namer � timestampr c C s dS )z�Adds an `Event`.
Adds a single `Event` with the name and, optionally, a timestamp and
attributes passed as arguments. Implementations should generate a
timestamp if the `timestamp` argument is omitted.
Nr �r r&