Skip to main content

pypi

This library contains OpenTelemetry Resource Detectors for the following Azure resources:

Installation

pip install opentelemetry-resource-detector-azure

Usage example for opentelemetry-resource-detector-azure

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 VM Resource Detector sets the following Resource Attributes according to the response from the Azure Metadata Service:
  • 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.

The Azure Functions Resource Detector is currently experimental. It 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.

For more information, see the Semantic Conventions for Cloud Resource Attributes.

References

Release files for opentelemetry-resource-detector-azure 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for opentelemetry-resource-detector-azure 0.2.0
File Size Uploaded
opentelemetry_resource_detector_azure-0.2.0.tar.gz 11.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for opentelemetry-resource-detector-azure 0.2.0
File Interpreter ABI Platform
opentelemetry_resource_detector_azure-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.9 kB

Release files / opentelemetry_resource_detector_azure-0.2.0.tar.gz

Download URL opentelemetry_resource_detector_azure-0.2.0.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7a82d1c1794a3b252de9b0cb393116ae260f8414a085010e1c334cea34c4677e
BLAKE2b-256 checksum
How to use checksums
fd39d42e29076bad36b07ac0894701b87a81b36b68a92359ccec50f01b3305d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release files / opentelemetry_resource_detector_azure-0.2.0-py3-none-any.whl

Download URL opentelemetry_resource_detector_azure-0.2.0-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0a8368e91356464bd3746848a8ef952e89a5e8c83673c7d4b722ad5f3716b45e
BLAKE2b-256 checksum
How to use checksums
675456bf2c4936ab482bef76a54603119c53c0ea4bdee0912966f2da07d8d43f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.21

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page