Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure resource detectors #1901

Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improved readme
  • Loading branch information
jeremydvoss committed Aug 9, 2023
commit b177c8c4c11aeb99d3368597bda9be2ec48c5e2f
57 changes: 26 additions & 31 deletions resource/opentelemetry-resource-detector-azure/README.rst
Original file line number Diff line number Diff line change
@@ -8,31 +8,31 @@ OpenTelemetry Resource detectors for Azure


jeremydvoss marked this conversation as resolved.
Show resolved Hide resolved
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.provider` set to the value of the "azure".
* `cloud.platform` set to the value of the "azure_app_service".
* `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 VM Resource Detector sets the following Resource Attributes:
* `azure.vm.scaleset.name`
* `azure.vm.sku`
* `cloud.platform`
* `cloud.provider`
* `cloud.region`
* `cloud.resource_id`
* `host.id`
* `host.name`
* `host.type`
* `os.type`
* `os.version`
* `service.instance.id`

For more information, see the Semantic Conventions for Cloud 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 VM Resource Detector sets the following Resource Attributes according to the response from the `Azure Metadata Service<https://learn.microsoft.com/en-us/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/>`.

Installation
------------
@@ -43,7 +43,7 @@ Installation

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

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

.. code-block:: python

@@ -70,13 +70,8 @@ Usage example for `opentelemetry-resource-detector-azure`
)
)

You can also enable the Resource Detectors by adding `azure_app_service` and/or `azure_vm` to the `OTEL_EXPERIMENTAL_RESOURCE_DETECTORS` environment variable:

`export OTEL_EXPERIMENTAL_RESOURCE_DETECTORS=azure_app_service,azure_vm`

References
----------

* `OpenTelemetry Project <https://opentelemetry.io/>`_
* `Resource Detector Docs <https://opentelemetry.io/docs/specs/otel/resource/sdk/#detecting-resource-information-from-the-environment>`
* `Cloud Semantic Conventions <https://opentelemetry.io/docs/specs/otel/resource/semantic_conventions/cloud/>`_