{"name":"@opentelemetry/resource-detector-azure","version":"0.17.0","author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","_id":"@opentelemetry/resource-detector-azure@0.17.0","maintainers":[{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"pichlermarc","email":"marc.pichler@dynatrace.com"}],"homepage":"https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/resource-detector-azure#readme","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js-contrib/issues"},"dist":{"shasum":"a659b3273380a94fac8b50709c2000598d437c90","tarball":"http://registry-npm.ywwl.com/@opentelemetry/resource-detector-azure/download/@opentelemetry/resource-detector-azure-0.17.0.tgz","fileCount":51,"integrity":"sha512-JGNPW+Om8MNiVOK1Jl5jg3znGJQP7YeGsgRQiegftqEZj0th8e1Uf6U5s6H672KBT442WDGOG0a4du5xJgJB5w==","signatures":[{"sig":"MEUCIDjAcVcruVDkkWoMaxpzdQswfha6iuj0fmfzKurx5PDFAiEAxie/70pPDgVWJ8Vs7CNEtdEoD1xxkUax78p/Jk6wurk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@opentelemetry%2fresource-detector-azure@0.17.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":189896,"size":28234,"noattachment":false,"key":"/@opentelemetry/resource-detector-azure/-/@opentelemetry/resource-detector-azure-0.17.0.tgz"},"main":"build/src/index.js","types":"build/src/index.d.ts","module":"build/esm/index.js","engines":{"node":"^18.19.0 || >=20.6.0"},"gitHead":"66935ac724cc271f70028035e534d47a4dfbcf12","scripts":{"tdd":"npm run test -- --watch-extensions ts --watch","test":"nyc mocha 'test/**/*.test.ts'","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json","compile":"tsc --build tsconfig.json tsconfig.esm.json","prepublishOnly":"npm run compile","compile:with-dependencies":"nx run-many -t compile -p @opentelemetry/resource-detector-azure"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:3495e5e0-c586-4baa-97c0-559709acd5ef"}},"repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js-contrib.git","type":"git","directory":"packages/resource-detector-azure"},"_npmVersion":"lerna/9.0.3/node@v24.12.0+x64 (linux)","description":"OpenTelemetry SDK resource detector for Azure","directories":{},"sideEffects":false,"_nodeVersion":"24.12.0","dependencies":{"@opentelemetry/core":"^2.0.0","@opentelemetry/resources":"^2.0.0","@opentelemetry/semantic-conventions":"^1.37.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@opentelemetry/api":"^1.0.0","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/contrib-test-utils":"^0.56.0","@opentelemetry/instrumentation-http":"^0.208.0"},"peerDependencies":{"@opentelemetry/api":"^1.0.0"},"_npmOperationalInternal":{"tmp":"tmp/resource-detector-azure_0.17.0_1766012493085_0.23500288031567962","host":"s3://npm-registry-packages-npm-production"},"readme":"# OpenTelemetry Resource Detector for Azure\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\n[component owners](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/.github/component_owners.yml): @JacksonWeber\n\nResource detector for Azure.\n\n## Installation\n\n```bash\nnpm install --save @opentelemetry/resource-detector-azure\n```\n\n## Usage\n\n```typescript\nimport { detectResources } from '@opentelemetry/resources';\nimport { azureAppServiceDetector } from '@opentelemetry/resource-detector-azure';\nconst resource = detectResources({\n    detectors: [azureAppServiceDetector],\n});\n\nconst tracerProvider = new NodeTracerProvider({ resource });\n```\n\n## Available Detectors\n\nThis package implements Semantic Convention [Version 1.37.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.37.0/semantic_conventions/README.md).\n\n### App Service Resource Detector\n\n| Resource Attribute          | Description                                                                                                                                                                                               |\n|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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`.                            |\n| cloud.platform              | The cloud platform. Here, it's always \"azure.app_service\".                                                                                                                                                |\n| cloud.provider              | The cloud service provider. In this context, it's always \"azure\".                                                                                                                                         |\n| cloud.region                | The Azure region where the App Service is hosted, e.g., \"East US\", \"West Europe\", etc.  Value of Process Environment Variable `REGION_NAME`.                                                              |\n| cloud.resource_id           | The Azure Resource Manager URI uniquely identifying the Azure App Service. Typically in the format `/subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Web/sites/{siteName}`. |\n| deployment.environment.name | The deployment slot where the Azure App Service is running, such as \"staging\", \"production\", etc. Value of Process Environment Variable `WEBSITE_SLOT_NAME`.                                              |\n| host.id                     | The primary hostname for the app, excluding any custom hostnames. Value of Process Environment Variable `WEBSITE_HOSTNAME`.                                                                               |\n| service.instance.id         | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value of Process Environment Variable `WEBSITE_INSTANCE_ID`.                                                        |\n| service.name                | The name of the Azure App Service. Value of Process Environment Variable `WEBSITE_SITE_NAME`.                                                                                                             |\n\n### VM Resource Detector\n\n| Resource Attribute     | Description                                                                                                                                                                                                                                                                                              |\n|------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| 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.                                                                                                                                                             |\n| 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 `sku` key on `/metadata/instance/compute` request.                                                                     |\n| cloud.platform         | The cloud platform, which is always set to \"azure.vm\" in this context.                                                                                                                                                                                                                                   |\n| cloud.provider         | The cloud service provider, which is always set to \"azure\" in this context.                                                                                                                                                                                                                              |\n| cloud.region           | The Azure region where the Virtual Machine is hosted, such as \"East US\", \"West Europe\", etc. Value from `location` key on `/metadata/instance/compute` request.                                                                                                                                          |\n| 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. |\n| host.id                | A unique identifier for the VM host, for instance, \"02aab8a4-74ef-476e-8182-f6d2ba4166a6\". Value from `vmId` key on `/metadata/instance/compute` request.                                                                                                                                                |\n| host.name              | The name of the host machine. Value from `name` key on `/metadata/instance/compute` request.                                                                                                                                                                                                             |\n| host.type              | The size of the VM instance, for example, \"Standard_D2s_v3\". Value from `vmSize` key on `/metadata/instance/compute` request.                                                                                                                                                                            |\n| os.version             | The version of the operating system running on the VM. Value from `version` key on `/metadata/instance/compute` request.                                                                                                                                                                                 |\n\n### Azure Functions Resource Detector\n\n| Resource Attribute | Description                                                                                                                                                                                                                                                                                        |\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| cloud.platform     | The cloud platform. Here, it's always \"azure.functions\".                                                                                                                                                                                                                                           |\n| cloud.provider     | The cloud service provider. In this context, it's always \"azure\".                                                                                                                                                                                                                                  |\n| 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`.                                                                                                                                                     |\n| faas.instance      | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value from Process Environment Variable `WEBSITE_INSTANCE_ID`.                                                                                                                                               |\n| faas.max_memory    | The amount of memory available to the Azure Function expressed in MiB. value from Process Environment Variable `WEBSITE_MEMORY_LIMIT_MB`.                                                                                                                                                          |\n| service.name       | The name of the service the Azure Functions runs within. Value from Process Environment Variable `WEBSITE_SITE_NAME`.                                                                                                                                                                              |\n| 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. |\n| process.pid        | The process ID collected from the running process.                                                                                                                                                                                                                                                 |\n\n### Azure Container Apps Resource Detector\n\n| Resource Attribute            | Description                                                                                                                                     |\n|-------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| azure.container_app.version | The revision of the Azure Container App. Value of Process Environment Variable `CONTAINER_APP_REVISION`.                                       |\n| cloud.platform                | The cloud platform. Here, it's always \"azure.container_apps\".                                                                                  |\n| cloud.provider                | The cloud service provider. In this context, it's always \"azure\".                                                                              |\n| azure.container_app.name                | The name of the Azure Container App. Value of Process Environment Variable `CONTAINER_APP_NAME`.                                               |\n| host.name                     | The hostname of the container. Value of Process Environment Variable `CONTAINER_APP_HOSTNAME.                             |\n| azure.container_app.instance.id           | The replica name of the Azure Container App instance. Value of Process Environment Variable `CONTAINER_APP_REPLICA_NAME`.                      |\n\n### Azure Kubernetes Service (AKS) Resource Detector\n\nThe AKS detector reads cluster metadata from the native `aks-cluster-metadata` ConfigMap in the `kube-public` namespace, which is automatically created by AKS. The ConfigMap contains a `clusterResourceId` key with the full ARM resource ID of the cluster.\n\n| Resource Attribute | Description                                                                                                                                                                                                  |\n|--------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| cloud.platform     | The cloud platform. Here, it's always \"azure.aks\".                                                                                                                                                           |\n| cloud.provider     | The cloud service provider. In this context, it's always \"azure\".                                                                                                                                            |\n| cloud.resource_id  | The Azure Resource Manager URI uniquely identifying the AKS cluster. Value from `clusterResourceId` key in the `aks-cluster-metadata` ConfigMap.                                                             |\n| k8s.cluster.name   | The name of the AKS cluster, extracted from the ARM resource ID.                                                                                                                                             |\n\n#### Usage\n\nTo use the AKS detector, configure your pod to read from the native `aks-cluster-metadata` ConfigMap in the `kube-public` namespace:\n\n```yaml\nenv:\n  - name: CLUSTER_RESOURCE_ID\n    valueFrom:\n      configMapKeyRef:\n        name: aks-cluster-metadata\n        key: clusterResourceId\n```\n\nAlternatively, you can mount the ConfigMap at `/etc/kubernetes/aks-cluster-metadata`. Kubernetes\nprojects each key into its own file, so the detector reads the resource ID from\n`/etc/kubernetes/aks-cluster-metadata/clusterResourceId`:\n\n```yaml\nvolumes:\n  - name: aks-cluster-metadata\n    configMap:\n      name: aks-cluster-metadata\nvolumeMounts:\n  - name: aks-cluster-metadata\n    mountPath: /etc/kubernetes/aks-cluster-metadata\n```\n\nMounting the single key with `subPath`, so that `/etc/kubernetes/aks-cluster-metadata` is itself a\nfile holding the resource ID, is also supported.\n\nNote that the `aks-cluster-metadata` ConfigMap lives in the `kube-public` namespace, and Kubernetes\nresolves `configMapKeyRef` and ConfigMap volumes within the pod's own namespace. To consume it from\nanother namespace, copy the ConfigMap into that namespace, or have tooling such as an init\ncontainer read it and write the value to one of the supported locations above.\n\n```typescript\nimport { detectResources } from '@opentelemetry/resources';\nimport { azureAksDetector } from '@opentelemetry/resource-detector-azure';\n\nconst resource = detectResources({\n    detectors: [azureAksDetector],\n});\n\nconst tracerProvider = new NodeTracerProvider({ resource });\n```\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/resource-detector-azure\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fresource-detector-azure.svg\n","publish_time":1766012493223,"_cnpm_publish_time":1766012493223,"dist-tags":{"latest":"0.33.0"}}