File: //var/opt/nydus/ops/mysql/opentelemetry/sdk/resources/__pycache__/__init__.cpython-39.pyc
a
�,�h�7 � @ s� d Z ddlZddlZddlZddlZddlZddlmZ ddl m
Z
ddlmZ ddl
mZ ddlmZmZmZ ddlmZ dd lmZmZ dd
lmZ eZejeef Ze�e�Z ej!Z!ej"Z"ej#Z#ej$Z$ej%Z%ej&Z&ej'Z'ej(Z(ej)Z)ej*Z*ej+Z+ej,Z,ej-Z-ej.Z.ej/Z/ej0Z0ej1Z1ej2Z2ej3Z4ej5Z6ej7Z8ej9Z:ej;Z<ej=Z>ej?Z@ejAZBejCZDejEZFejGZHejIZJejKZLejMZNejOZPejQZRejSZTejUZUejVZVejWZWejXZXejYZYejZZZej[Z[ej\Z\ej]Z]ej^Z^ej_Z_ej`Z`ejaZaejbZbejcZcejdZdejeZeejfZfejgZgejhZhed�ZiG dd
� d
�Zjeji �Zkejehdeedefeii�ZlG dd� dejm�ZnG dd� den�ZoG dd� den�Zpdejqd ejrej d
d�dd�ZsdS )a�
This package implements `OpenTelemetry Resources
<https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-sdk>`_:
*A Resource is an immutable representation of the entity producing
telemetry. For example, a process producing telemetry that is running in
a container on Kubernetes has a Pod name, it is in a namespace and
possibly is part of a Deployment which also has a name. All three of
these attributes can be included in the Resource.*
Resource objects are created with `Resource.create`, which accepts attributes
(key-values). Resources should NOT be created via constructor, and working with
`Resource` objects should only be done via the Resource API methods. Resource
attributes can also be passed at process invocation in the
:envvar:`OTEL_RESOURCE_ATTRIBUTES` environment variable. You should register
your resource with the `mysql.opentelemetry.sdk.trace.TracerProvider` by passing
them into their constructors. The `Resource` passed to a provider is available
to the exporter, which can send on this information as it sees fit.
.. code-block:: python
trace.set_tracer_provider(
TracerProvider(
resource=Resource.create({
"service.name": "shoppingcart",
"service.instance.id": "instance-12",
}),
),
)
print(trace.get_tracer_provider().resource.attributes)
{'telemetry.sdk.language': 'python',
'telemetry.sdk.name': 'opentelemetry',
'telemetry.sdk.version': '0.13.dev0',
'service.name': 'shoppingcart',
'service.instance.id': 'instance-12'}
Note that the OpenTelemetry project documents certain `"standard attributes"
<https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md>`_
that have prescribed semantic meanings, for example ``service.name`` in the
above example.
� N)�dumps)�environ)�parse)�BoundedAttributes)�$OTEL_EXPERIMENTAL_RESOURCE_DETECTORS�OTEL_RESOURCE_ATTRIBUTES�OTEL_SERVICE_NAME)�ResourceAttributes)�entry_points�version)�AttributeValuezopentelemetry-sdkc @ s� e Zd ZdZdeeje d�dd�Ze deje eje d d�dd��Z
e d d �d
d��Zeed �dd
��Z
eed �dd��Zd d d�dd�Zeed�dd�Zdd� Zded �dd�ZdS )�ResourcezZA Resource is an immutable representation of the entity producing telemetry as Attributes.N��
attributes�
schema_urlc C s"