OpenTelemetry SDK resource detector for Azure
npm install @opentelemetry/resource-detector-azure[![NPM Published Version][npm-img]][npm-url]
[![Apache License][license-image]][license-image]
component owners: @JacksonWeber
Resource detector for Azure.
``bash`
npm install --save @opentelemetry/resource-detector-azure
`typescript
import { detectResources } from '@opentelemetry/resources';
import { azureAppServiceDetector } from '@opentelemetry/resource-detector-azure';
const resource = detectResources({
detectors: [azureAppServiceDetector],
});
const tracerProvider = new NodeTracerProvider({ resource });
`
This package implements Semantic Convention Version 1.37.0.
| Resource Attribute | Description |
|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| azure.app.service.stamp | The specific "stamp" cluster within Azure where the App Service is running, e.g., "waws-prod-sn1-001". Value of Process Environment Variable APP_SERVICE_ATTRIBUTE_ENV_VARS. |REGION_NAME
| cloud.platform | The cloud platform. Here, it's always "azure.app_service". |
| cloud.provider | The cloud service provider. In this context, it's always "azure". |
| cloud.region | The Azure region where the App Service is hosted, e.g., "East US", "West Europe", etc. Value of Process Environment Variable . |/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Web/sites/{siteName}
| cloud.resource_id | The Azure Resource Manager URI uniquely identifying the Azure App Service. Typically in the format . |WEBSITE_SLOT_NAME
| deployment.environment.name | The deployment slot where the Azure App Service is running, such as "staging", "production", etc. Value of Process Environment Variable . |WEBSITE_HOSTNAME
| host.id | The primary hostname for the app, excluding any custom hostnames. Value of Process Environment Variable . |WEBSITE_INSTANCE_ID
| service.instance.id | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value of Process Environment Variable . |WEBSITE_SITE_NAME
| service.name | The name of the Azure App Service. Value of Process Environment Variable . |
| Resource Attribute | Description |
|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| azure.vm.scaleset.name | The name of the Virtual Machine Scale Set if the VM is part of one. Value from vmScaleSetName key on /metadata/instance/compute request. |sku
| azure.vm.sku | The SKU of the Azure Virtual Machine's operating system. For instance, for a VM running Windows Server 2019 Datacenter edition, this value would be "2019-Datacenter". Value from key on /metadata/instance/compute request. |location
| cloud.platform | The cloud platform, which is always set to "azure.vm" in this context. |
| cloud.provider | The cloud service provider, which is always set to "azure" in this context. |
| cloud.region | The Azure region where the Virtual Machine is hosted, such as "East US", "West Europe", etc. Value from key on /metadata/instance/compute request. |/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/virtualMachines/{vmName}
| cloud.resource_id | The Azure Resource Manager URI uniquely identifying the Azure Virtual Machine. It typically follows this format: . Value from resourceId key on /metadata/instance/compute request. |vmId
| host.id | A unique identifier for the VM host, for instance, "02aab8a4-74ef-476e-8182-f6d2ba4166a6". Value from key on /metadata/instance/compute request. |name
| host.name | The name of the host machine. Value from key on /metadata/instance/compute request. |vmSize
| host.type | The size of the VM instance, for example, "Standard_D2s_v3". Value from key on /metadata/instance/compute request. |version
| os.version | The version of the operating system running on the VM. Value from key on /metadata/instance/compute request. |
| Resource Attribute | Description |
|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| cloud.platform | The cloud platform. Here, it's always "azure.functions". |
| cloud.provider | The cloud service provider. In this context, it's always "azure". |
| cloud.region | The Azure region where the Azure Function is hosted, e.g., "East US", "West Europe", etc. Value of Process Environment Variable REGION_NAME. |WEBSITE_INSTANCE_ID
| faas.instance | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value from Process Environment Variable . |WEBSITE_MEMORY_LIMIT_MB
| faas.max_memory | The amount of memory available to the Azure Function expressed in MiB. value from Process Environment Variable . |WEBSITE_SITE_NAME`. |
| service.name | The name of the service the Azure Functions runs within. Value from Process Environment Variable
| cloud.resource_id | The Azure Resource Manager URI uniquely identifying the Azure Virtual Machine. It typically follows this format: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Compute/virtualMachines/{vmName}. Value from resourceId key on /metadata/instance/compute request. |
| process.pid | The process ID collected from the running process. |
- For more information on OpenTelemetry, visit:
- For more about OpenTelemetry JavaScript:
- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]
Apache 2.0 - See [LICENSE][license-url] for more information.
[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[npm-url]: https://www.npmjs.com/package/@opentelemetry/resource-detector-azure
[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fresource-detector-azure.svg