aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/opentelemetry_resource_detector_azure-0.1.5.dist-info/METADATA
blob: 19683cafe1c957fdaf636ea964fb220bf20f8435 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
Metadata-Version: 2.3
Name: opentelemetry-resource-detector-azure
Version: 0.1.5
Summary: Azure Resource Detector for OpenTelemetry
Project-URL: Homepage, https://github.com/open-telemetry/opentelemetry-python-contrib/tree/main/resource/opentelemetry-resource-detector-azure
Author-email: OpenTelemetry Authors <cncf-opentelemetry-contributors@lists.cncf.io>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Python: >=3.8
Requires-Dist: opentelemetry-sdk~=1.21
Description-Content-Type: text/x-rst

OpenTelemetry Resource detectors for Azure
==========================================

|pypi|

.. |pypi| image:: https://badge.fury.io/py/opentelemetry-resource-detector-azure.svg
   :target: https://pypi.org/project/opentelemetry-resource-detector-azure/

This library contains OpenTelemetry `Resource Detectors <https://opentelemetry.io/docs/specs/otel/resource/sdk/#detecting-resource-information-from-the-environment>`_ for the following Azure resources:
 * `Azure App Service <https://azure.microsoft.com/en-us/products/app-service>`_
 * `Azure Virtual Machines <https://azure.microsoft.com/en-us/products/virtual-machines>`_

Installation
------------

::

    pip install opentelemetry-resource-detector-azure

---------------------------

Usage example for ``opentelemetry-resource-detector-azure``

.. code-block:: python

    from opentelemetry import trace
    from opentelemetry.sdk.trace import TracerProvider
    from opentelemetry.resource.detector.azure.app_service import (
        AzureAppServiceResourceDetector,
        AzureVMResourceDetector,
    )
    from opentelemetry.resource.detector.azure.vm import (
        AzureVMResourceDetector,
    )
    from opentelemetry.sdk.resources import get_aggregated_resources


    trace.set_tracer_provider(
        TracerProvider(
            resource=get_aggregated_resources(
                [
                    AzureAppServiceResourceDetector(),
                    AzureVMResourceDetector(),
                ]
            ),
        )
    )

Mappings
--------

The Azure App Service Resource Detector sets the following Resource Attributes:
 * ``service.name`` set to the value of the ``WEBSITE_SITE_NAME`` environment variable.
 * ``cloud.platform`` set to ``azure_app_service``.
 * ``cloud.provider`` set to ``azure``.
 * ``cloud.resource_id`` set using the ``WEBSITE_RESOURCE_GROUP``, ``WEBSITE_OWNER_NAME``, and ``WEBSITE_SITE_NAME`` environment variables.
 * ``cloud.region`` set to the value of the ``REGION_NAME`` environment variable.
 * ``deployment.environment`` set to the value of the ``WEBSITE_SLOT_NAME`` environment variable.
 * ``host.id`` set to the value of the ``WEBSITE_HOSTNAME`` environment variable.
 * ``service.instance.id`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable.
 * ``azure.app.service.stamp`` set to the value of the ``WEBSITE_HOME_STAMPNAME`` environment variable.

 The Azure Functions Resource Detector sets the following Resource Attributes:
 * ``service.name`` set to the value of the ``WEBSITE_SITE_NAME`` environment variable.
 * ``process.id`` set to the process ID collected from the running process.
 * ``cloud.platform`` set to ``azure_functions``.
 * ``cloud.provider`` set to ``azure``.
 * ``cloud.resource_id`` set using the ``WEBSITE_RESOURCE_GROUP``, ``WEBSITE_OWNER_NAME``, and ``WEBSITE_SITE_NAME`` environment variables.
 * ``cloud.region`` set to the value of the ``REGION_NAME`` environment variable.
 * ``faas.instance`` set to the value of the ``WEBSITE_INSTANCE_ID`` environment variable.
 * ``faas.max_memory`` set to the value of the ``WEBSITE_MEMORY_LIMIT_MB`` environment variable.

The Azure VM Resource Detector sets the following Resource Attributes according to the response from the `Azure Metadata Service <https://learn.microsoft.com/azure/virtual-machines/instance-metadata-service?tabs=windows>`_:
 * ``azure.vm.scaleset.name`` set to the value of the ``vmScaleSetName`` field.
 * ``azure.vm.sku`` set to the value of the ``sku`` field.
 * ``cloud.platform`` set to the value of the ``azure_vm``.
 * ``cloud.provider`` set to the value of the ``azure``.
 * ``cloud.region`` set to the value of the ``location`` field.
 * ``cloud.resource_id`` set to the value of the ``resourceId`` field.
 * ``host.id`` set to the value of the ``vmId`` field.
 * ``host.name`` set to the value of the ``name`` field.
 * ``host.type`` set to the value of the ``vmSize`` field.
 * ``os.type`` set to the value of the ``osType`` field.
 * ``os.version`` set to the value of the ``version`` field.
 * ``service.instance.id`` set to the value of the ``vmId`` field.

For more information, see the `Semantic Conventions for Cloud Resource Attributes <https://opentelemetry.io/docs/specs/otel/resource/semantic_conventions/cloud/>`_.

References
----------

* `OpenTelemetry Project <https://opentelemetry.io/>`_