Skip to main content

Azure Resource Detector for OpenTelemetry

Reason this release was yanked:

Timeout is set to 10 seconds instead of 4.

Project description

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.

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

References

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

File details

Details for the file opentelemetry_resource_detector_azure-0.1.2.tar.gz.

File metadata

File hashes

Hashes for opentelemetry_resource_detector_azure-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5204de4f6247e36966f82d55f5a17dc65ab03fbe84392066d24df68b83c5b4ce
MD5 ac2aadb2ca938c63b044d5640ee3e8d8
BLAKE2b-256 bcd0a407067bd82045a1fa487d1f5b63b0f90562f5d8cebbfbc0bb74e6b4f1b9

See more details on using hashes here.

File details

Details for the file opentelemetry_resource_detector_azure-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for opentelemetry_resource_detector_azure-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 af86dd66caa5ec2bb44cd2c875bc7cb4c874480ee4905f5c8a38c8a396cf30b3
MD5 bfb538ba7e9166dfa9659f28baf7f571
BLAKE2b-256 fe63657150422d3aec1dd51ddca3fc4ca8ac65cbf3fe0d03eefc76439b9a8279

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page