@opentelemetry/resource-detector-azure 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -31,45 +31,45 @@ This package implements Semantic Convention [Version 1.37.0](https://github.com/
31
31
 
32
32
  ### App Service Resource Detector
33
33
 
34
- | Resource Attribute | Description |
35
- |-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36
- | 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`. |
37
- | cloud.platform | The cloud platform. Here, it's always "azure.app_service". |
38
- | cloud.provider | The cloud service provider. In this context, it's always "azure". |
39
- | 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`. |
40
- | 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}`. |
41
- | 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`. |
42
- | host.id | The primary hostname for the app, excluding any custom hostnames. Value of Process Environment Variable `WEBSITE_HOSTNAME`. |
43
- | 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`. |
44
- | service.name | The name of the Azure App Service. Value of Process Environment Variable `WEBSITE_SITE_NAME`. |
34
+ | Resource Attribute | Description |
35
+ |-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
36
+ | 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`. |
37
+ | cloud.platform | The cloud platform. Here, it's always "azure.app_service". |
38
+ | cloud.provider | The cloud service provider. In this context, it's always "azure". |
39
+ | 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`. |
40
+ | 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}`. |
41
+ | 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`. |
42
+ | host.id | The primary hostname for the app, excluding any custom hostnames. Value of Process Environment Variable `WEBSITE_HOSTNAME`. |
43
+ | 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`. |
44
+ | service.name | The name of the Azure App Service. Value of Process Environment Variable `WEBSITE_SITE_NAME`. |
45
45
 
46
46
  ### VM Resource Detector
47
47
 
48
- | Resource Attribute | Description |
49
- |--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
50
- | 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. |
51
- | 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. |
52
- | cloud.platform | The cloud platform, which is always set to "azure.vm" in this context. |
53
- | cloud.provider | The cloud service provider, which is always set to "azure" in this context. |
54
- | 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. |
55
- | 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.|
56
- | 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. |
57
- | host.name | The name of the host machine. Value from `name` key on `/metadata/instance/compute` request. |
58
- | host.type | The size of the VM instance, for example, "Standard_D2s_v3". Value from `vmSize` key on `/metadata/instance/compute` request. |
59
- | os.version | The version of the operating system running on the VM. Value from `version` key on `/metadata/instance/compute` request. |
48
+ | Resource Attribute | Description |
49
+ |------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
50
+ | 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. |
51
+ | 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. |
52
+ | cloud.platform | The cloud platform, which is always set to "azure.vm" in this context. |
53
+ | cloud.provider | The cloud service provider, which is always set to "azure" in this context. |
54
+ | 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. |
55
+ | 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. |
56
+ | 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. |
57
+ | host.name | The name of the host machine. Value from `name` key on `/metadata/instance/compute` request. |
58
+ | host.type | The size of the VM instance, for example, "Standard_D2s_v3". Value from `vmSize` key on `/metadata/instance/compute` request. |
59
+ | os.version | The version of the operating system running on the VM. Value from `version` key on `/metadata/instance/compute` request. |
60
60
 
61
61
  ### Azure Functions Resource Detector
62
62
 
63
- | Resource Attribute | Description |
64
- |-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
65
- | cloud.platform | The cloud platform. Here, it's always "azure.functions". |
66
- | cloud.provider | The cloud service provider. In this context, it's always "azure". |
67
- | 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`. |
68
- | faas.instance | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value from Process Environment Variable `WEBSITE_INSTANCE_ID`. |
69
- | faas.max_memory | The amount of memory available to the Azure Function expressed in MiB. value from Process Environment Variable `WEBSITE_MEMORY_LIMIT_MB`. |
70
- | service.name | The name of the service the Azure Functions runs within. Value from Process Environment Variable `WEBSITE_SITE_NAME`. |
71
- | 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. |
72
- | process.pid | The process ID collected from the running process. |
63
+ | Resource Attribute | Description |
64
+ |--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
65
+ | cloud.platform | The cloud platform. Here, it's always "azure.functions". |
66
+ | cloud.provider | The cloud service provider. In this context, it's always "azure". |
67
+ | 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`. |
68
+ | faas.instance | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value from Process Environment Variable `WEBSITE_INSTANCE_ID`. |
69
+ | faas.max_memory | The amount of memory available to the Azure Function expressed in MiB. value from Process Environment Variable `WEBSITE_MEMORY_LIMIT_MB`. |
70
+ | service.name | The name of the service the Azure Functions runs within. Value from Process Environment Variable `WEBSITE_SITE_NAME`. |
71
+ | 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. |
72
+ | process.pid | The process ID collected from the running process. |
73
73
 
74
74
  ## Useful links
75
75
 
@@ -1 +1 @@
1
- {"version":3,"file":"AzureAppServiceDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureAppServiceDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,0CAA0C,EAC1C,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oCAAoC,GACrC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,8BAA8B,GAAG;IACrC,CAAC,iBAAiB,CAAC,EAAE,WAAW;IAChC,CAAC,gCAAgC,CAAC,EAAE,iBAAiB;IACrD,CAAC,YAAY,CAAC,EAAE,gBAAgB;IAChC,CAAC,wBAAwB,CAAC,EAAE,mBAAmB;IAC/C,CAAC,0CAA0C,CAAC,EAAE,sBAAsB;CACrE,CAAC;AAEF;;;GAGG;AACH,MAAM,uBAAuB;IAC3B,MAAM;QACJ,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACvD,IAAI,eAAe,IAAI,CAAC,eAAe,EAAE,EAAE;YACzC,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,iBAAiB,CAAC,EAAE,eAAe;aACrC,CAAC;YACF,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,mBAAmB,CAAC,EAAE,0BAA0B;aAClD,CAAC;YACF,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,mBAAmB,CAAC,EAAE,sCAAsC;aAC9D,CAAC;YAEF,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;YAC9D,IAAI,gBAAgB,EAAE;gBACpB,UAAU,GAAG;oBACX,GAAG,UAAU;oBACb,GAAG,EAAE,CAAC,oCAAoC,CAAC,EAAE,gBAAgB,EAAE;iBAChE,CAAC;aACH;YAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CACvC,8BAA8B,CAC/B,EAAE;gBACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAClC,IAAI,MAAM,EAAE;oBACV,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport {\n AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE,\n REGION_NAME,\n WEBSITE_HOME_STAMPNAME,\n WEBSITE_HOSTNAME,\n WEBSITE_INSTANCE_ID,\n WEBSITE_SITE_NAME,\n WEBSITE_SLOT_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_CLOUD_REGION,\n ATTR_DEPLOYMENT_ENVIRONMENT_NAME,\n ATTR_HOST_ID,\n ATTR_SERVICE_INSTANCE_ID,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n} from '../semconv';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst APP_SERVICE_ATTRIBUTE_ENV_VARS = {\n [ATTR_CLOUD_REGION]: REGION_NAME,\n [ATTR_DEPLOYMENT_ENVIRONMENT_NAME]: WEBSITE_SLOT_NAME,\n [ATTR_HOST_ID]: WEBSITE_HOSTNAME,\n [ATTR_SERVICE_INSTANCE_ID]: WEBSITE_INSTANCE_ID,\n [AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE]: WEBSITE_HOME_STAMPNAME,\n};\n\n/**\n * The AzureAppServiceDetector can be used to detect if a process is running in an Azure App Service\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureAppServiceDetector implements ResourceDetector {\n detect(): DetectedResource {\n let attributes = {};\n const websiteSiteName = process.env[WEBSITE_SITE_NAME];\n if (websiteSiteName && !isAzureFunction()) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: websiteSiteName,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n };\n\n const azureResourceUri = getAzureResourceUri(websiteSiteName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n APP_SERVICE_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureAppServiceDetector = new AzureAppServiceDetector();\n"]}
1
+ {"version":3,"file":"AzureAppServiceDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureAppServiceDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EACL,0CAA0C,EAC1C,WAAW,EACX,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,oCAAoC,GACrC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACL,iBAAiB,EACjB,gCAAgC,EAChC,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,sCAAsC,GACvC,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,8BAA8B,GAAG;IACrC,CAAC,iBAAiB,CAAC,EAAE,WAAW;IAChC,CAAC,gCAAgC,CAAC,EAAE,iBAAiB;IACrD,CAAC,YAAY,CAAC,EAAE,gBAAgB;IAChC,CAAC,wBAAwB,CAAC,EAAE,mBAAmB;IAC/C,CAAC,0CAA0C,CAAC,EAAE,sBAAsB;CACrE,CAAC;AAEF;;;GAGG;AACH,MAAM,uBAAuB;IACpB,MAAM;QACX,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QACvD,IAAI,eAAe,IAAI,CAAC,eAAe,EAAE,EAAE;YACzC,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,iBAAiB,CAAC,EAAE,eAAe;aACrC,CAAC;YACF,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,mBAAmB,CAAC,EAAE,0BAA0B;aAClD,CAAC;YACF,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,mBAAmB,CAAC,EAAE,sCAAsC;aAC9D,CAAC;YAEF,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,eAAe,CAAC,CAAC;YAC9D,IAAI,gBAAgB,EAAE;gBACpB,UAAU,GAAG;oBACX,GAAG,UAAU;oBACb,GAAG,EAAE,CAAC,oCAAoC,CAAC,EAAE,gBAAgB,EAAE;iBAChE,CAAC;aACH;YAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CACvC,8BAA8B,CAC/B,EAAE;gBACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAClC,IAAI,MAAM,EAAE;oBACV,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport {\n AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE,\n REGION_NAME,\n WEBSITE_HOME_STAMPNAME,\n WEBSITE_HOSTNAME,\n WEBSITE_INSTANCE_ID,\n WEBSITE_SITE_NAME,\n WEBSITE_SLOT_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_CLOUD_REGION,\n ATTR_DEPLOYMENT_ENVIRONMENT_NAME,\n ATTR_HOST_ID,\n ATTR_SERVICE_INSTANCE_ID,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n} from '../semconv';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst APP_SERVICE_ATTRIBUTE_ENV_VARS = {\n [ATTR_CLOUD_REGION]: REGION_NAME,\n [ATTR_DEPLOYMENT_ENVIRONMENT_NAME]: WEBSITE_SLOT_NAME,\n [ATTR_HOST_ID]: WEBSITE_HOSTNAME,\n [ATTR_SERVICE_INSTANCE_ID]: WEBSITE_INSTANCE_ID,\n [AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE]: WEBSITE_HOME_STAMPNAME,\n};\n\n/**\n * The AzureAppServiceDetector can be used to detect if a process is running in an Azure App Service\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureAppServiceDetector implements ResourceDetector {\n public detect(): DetectedResource {\n let attributes = {};\n const websiteSiteName = process.env[WEBSITE_SITE_NAME];\n if (websiteSiteName && !isAzureFunction()) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: websiteSiteName,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n };\n\n const azureResourceUri = getAzureResourceUri(websiteSiteName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n APP_SERVICE_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureAppServiceDetector = new AzureAppServiceDetector();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureFunctionsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureFunctionsDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,oCAAoC,EACpC,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,WAAW,EACX,oCAAoC,GACrC,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAEhE,MAAM,kCAAkC,GAAG;IACzC,CAAC,iBAAiB,CAAC,EAAE,iBAAiB;IACtC,CAAC,kBAAkB,CAAC,EAAE,mBAAmB;IACzC,CAAC,oBAAoB,CAAC,EAAE,mBAAmB;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,sBAAsB;IAC1B,MAAM;QACJ,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,MAAM,WAAW,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAEnD;;;;WAIG;QACH,IAAI,WAAW,IAAI,eAAe,EAAE,EAAE;YACpC,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;YAC1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AM,CAAC,MAAM,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_FAAS_MAX_MEMORY,\n ATTR_FAAS_INSTANCE,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n ATTR_CLOUD_REGION,\n ATTR_PROCESS_PID,\n} from '../semconv';\nimport {\n WEBSITE_SITE_NAME,\n WEBSITE_INSTANCE_ID,\n FUNCTIONS_MEM_LIMIT,\n REGION_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS = {\n [ATTR_SERVICE_NAME]: WEBSITE_SITE_NAME,\n [ATTR_FAAS_INSTANCE]: WEBSITE_INSTANCE_ID,\n [ATTR_FAAS_MAX_MEMORY]: FUNCTIONS_MEM_LIMIT,\n};\n\n/**\n * The AzureFunctionsDetector can be used to detect if a process is running in Azure Functions\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureFunctionsDetector implements ResourceDetector {\n detect(): DetectedResource {\n let attributes = {};\n const serviceName = process.env[WEBSITE_SITE_NAME];\n\n /**\n * Checks that we are operating within an Azure Function using the function version since WEBSITE_SITE_NAME\n * will exist in Azure App Service as well and detectors should be mutually exclusive.\n * If the function version is not present, we check for the website sku to determine if it is a function.\n */\n if (serviceName && isAzureFunction()) {\n const functionInstance = process.env[WEBSITE_INSTANCE_ID];\n const functionMemLimit = process.env[FUNCTIONS_MEM_LIMIT];\n\n attributes = {\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n [ATTR_CLOUD_REGION]: process.env[REGION_NAME],\n [ATTR_PROCESS_PID]: process.pid,\n };\n\n if (serviceName) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: serviceName,\n };\n }\n if (functionInstance) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_INSTANCE]: functionInstance,\n };\n }\n if (functionMemLimit) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_MAX_MEMORY]: functionMemLimit,\n };\n }\n const azureResourceUri = getAzureResourceUri(serviceName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureFunctionsDetector = new AzureFunctionsDetector();\n"]}
1
+ {"version":3,"file":"AzureFunctionsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureFunctionsDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,EAC1B,mBAAmB,EACnB,oCAAoC,EACpC,iBAAiB,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,GAAG;oBACX,GAAG,UAAU;oBACb,CAAC,oBAAoB,CAAC,EAAE,gBAAgB;iBACzC,CAAC;aACH;YACD,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAC;YAC1D,IAAI,gBAAgB,EAAE;gBACpB,UAAU,GAAG;oBACX,GAAG,UAAU;oBACb,GAAG,EAAE,CAAC,oCAAoC,CAAC,EAAE,gBAAgB,EAAE;iBAChE,CAAC;aACH;YAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CACvC,kCAAkC,CACnC,EAAE;gBACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAClC,IAAI,MAAM,EAAE;oBACV,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_FAAS_MAX_MEMORY,\n ATTR_FAAS_INSTANCE,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n ATTR_CLOUD_REGION,\n ATTR_PROCESS_PID,\n} from '../semconv';\nimport {\n WEBSITE_SITE_NAME,\n WEBSITE_INSTANCE_ID,\n FUNCTIONS_MEM_LIMIT,\n REGION_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS = {\n [ATTR_SERVICE_NAME]: WEBSITE_SITE_NAME,\n [ATTR_FAAS_INSTANCE]: WEBSITE_INSTANCE_ID,\n [ATTR_FAAS_MAX_MEMORY]: FUNCTIONS_MEM_LIMIT,\n};\n\n/**\n * The AzureFunctionsDetector can be used to detect if a process is running in Azure Functions\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureFunctionsDetector implements ResourceDetector {\n public detect(): DetectedResource {\n let attributes = {};\n const serviceName = process.env[WEBSITE_SITE_NAME];\n\n /**\n * Checks that we are operating within an Azure Function using the function version since WEBSITE_SITE_NAME\n * will exist in Azure App Service as well and detectors should be mutually exclusive.\n * If the function version is not present, we check for the website sku to determine if it is a function.\n */\n if (serviceName && isAzureFunction()) {\n const functionInstance = process.env[WEBSITE_INSTANCE_ID];\n const functionMemLimit = process.env[FUNCTIONS_MEM_LIMIT];\n\n attributes = {\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n [ATTR_CLOUD_REGION]: process.env[REGION_NAME],\n [ATTR_PROCESS_PID]: process.pid,\n };\n\n if (serviceName) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: serviceName,\n };\n }\n if (functionInstance) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_INSTANCE]: functionInstance,\n };\n }\n if (functionMemLimit) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_MAX_MEMORY]: functionMemLimit,\n };\n }\n const azureResourceUri = getAzureResourceUri(serviceName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureFunctionsDetector = new AzureFunctionsDetector();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureVmDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureVmDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oCAAoC,EACpC,sBAAsB,EACtB,sBAAsB,EACtB,iCAAiC,EACjC,sBAAsB,GAEvB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,uBAAuB;IAC3B,MAAM;QACJ,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CACvE,IAAI,CAAC,kBAAkB,EAAE,CAC1B,CAAC;QAEF,MAAM,SAAS,GAAG;YAChB,iCAAiC;YACjC,sBAAsB;YACtB,mBAAmB;YACnB,mBAAmB;YACnB,iBAAiB;YACjB,oCAAoC;YACpC,Y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SACnB;QAAC,OAAO,GAAQ,EAAE;YACjB,IAAI,CAAC,KAAK,CACR,sDAAsD,EACtD,GAAG,CAAC,OAAO,CACZ,CAAC;YACF,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as http from 'http';\n\nimport { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n} from '@opentelemetry/resources';\nimport {\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_VM,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_REGION,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n} from '../semconv';\nimport {\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n AZURE_VM_METADATA_HOST,\n AZURE_VM_METADATA_PATH,\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n AzureVmMetadata,\n} from '../types';\n\n/**\n * The AzureVmDetector can be used to detect if a process is running in an Azure VM.\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureVmResourceDetector implements ResourceDetector {\n detect(): DetectedResource {\n const dataPromise = context.with(suppressTracing(context.active()), () =>\n this.getAzureVmMetadata()\n );\n\n const attrNames = [\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_REGION,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n ];\n\n const attributes = {} as DetectedResourceAttributes;\n attrNames.forEach(name => {\n // Each resource attribute is determined asynchronously in _gatherData().\n attributes[name] = dataPromise.then(data => data[name]);\n });\n\n return { attributes };\n }\n\n async getAzureVmMetadata(): Promise<DetectedResourceAttributes> {\n try {\n const options = {\n host: AZURE_VM_METADATA_HOST,\n path: AZURE_VM_METADATA_PATH,\n method: 'GET',\n timeout: 5000,\n headers: {\n Metadata: 'True',\n },\n };\n const metadata: AzureVmMetadata = await new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n req.destroy();\n reject(new Error('Azure metadata service request timed out.'));\n }, 1000);\n\n const req = http.request(options, res => {\n clearTimeout(timeoutId);\n const { statusCode } = res;\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', chunk => (rawData += chunk));\n res.on('end', () => {\n if (statusCode && statusCode >= 200 && statusCode < 300) {\n try {\n resolve(JSON.parse(rawData));\n } catch (error) {\n reject(error);\n }\n } else {\n reject(\n new Error('Failed to load page, status code: ' + statusCode)\n );\n }\n });\n });\n req.on('error', err => {\n clearTimeout(timeoutId);\n reject(err);\n });\n req.end();\n });\n\n const attributes = {\n [AZURE_VM_SCALE_SET_NAME_ATTRIBUTE]: metadata['vmScaleSetName'],\n [AZURE_VM_SKU_ATTRIBUTE]: metadata['sku'],\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_VM,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_REGION]: metadata['location'],\n [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: metadata['resourceId'],\n [ATTR_HOST_ID]: metadata['vmId'],\n [ATTR_HOST_NAME]: metadata['name'],\n [ATTR_HOST_TYPE]: metadata['vmSize'],\n [ATTR_OS_VERSION]: metadata['version'],\n };\n return attributes;\n } catch (err: any) {\n diag.debug(\n 'AzureVmResourceDetector: not running in an Azure VM:',\n err.message\n );\n return {};\n }\n }\n}\n\nexport const azureVmDetector = new AzureVmResourceDetector();\n"]}
1
+ {"version":3,"file":"AzureVmDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureVmDetector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAMtD,OAAO,EACL,mBAAmB,EACnB,6BAA6B,EAC7B,mBAAmB,EACnB,0BAA0B,EAC1B,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,cAAc,EACd,eAAe,GAChB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,oCAAoC,EACpC,sBAAsB,EACtB,sBAAsB,EACtB,iCAAiC,EACjC,sBAAsB,GAEvB,MAAM,UAAU,CAAC;AAElB;;;GAGG;AACH,MAAM,uBAAuB;IACpB,MAAM;QACX,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CACvE,IAAI,CAAC,kBAAkB,EAAE,CAC1B,CAAC;QAEF,MAAM,SAAS,GAAG;YAChB,iCAAiC;YACjC,sBAAsB;YACtB,mBAAmB;YACnB,mBAAmB;YACnB,iBAAiB;YACjB,oCAAoC;YACpC,YAAY;YACZ,cAAc;YACd,cAAc;YACd,eAAe;SAChB,CAAC;QAEF,MAAM,UAAU,GAAG,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D,GAAG,CAAC,OAAO,CACZ,CAAC;YACF,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as http from 'http';\n\nimport { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n} from '@opentelemetry/resources';\nimport {\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_VM,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_REGION,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n} from '../semconv';\nimport {\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n AZURE_VM_METADATA_HOST,\n AZURE_VM_METADATA_PATH,\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n AzureVmMetadata,\n} from '../types';\n\n/**\n * The AzureVmDetector can be used to detect if a process is running in an Azure VM.\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureVmResourceDetector implements ResourceDetector {\n public detect(): DetectedResource {\n const dataPromise = context.with(suppressTracing(context.active()), () =>\n this.getAzureVmMetadata()\n );\n\n const attrNames = [\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_REGION,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n ];\n\n const attributes = {} as DetectedResourceAttributes;\n attrNames.forEach(name => {\n // Each resource attribute is determined asynchronously in _gatherData().\n attributes[name] = dataPromise.then(data => data[name]);\n });\n\n return { attributes };\n }\n\n public async getAzureVmMetadata(): Promise<DetectedResourceAttributes> {\n try {\n const options = {\n host: AZURE_VM_METADATA_HOST,\n path: AZURE_VM_METADATA_PATH,\n method: 'GET',\n timeout: 5000,\n headers: {\n Metadata: 'True',\n },\n };\n const metadata: AzureVmMetadata = await new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n req.destroy();\n reject(new Error('Azure metadata service request timed out.'));\n }, 1000);\n\n const req = http.request(options, res => {\n clearTimeout(timeoutId);\n const { statusCode } = res;\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', chunk => (rawData += chunk));\n res.on('end', () => {\n if (statusCode && statusCode >= 200 && statusCode < 300) {\n try {\n resolve(JSON.parse(rawData));\n } catch (error) {\n reject(error);\n }\n } else {\n reject(\n new Error('Failed to load page, status code: ' + statusCode)\n );\n }\n });\n });\n req.on('error', err => {\n clearTimeout(timeoutId);\n reject(err);\n });\n req.end();\n });\n\n const attributes = {\n [AZURE_VM_SCALE_SET_NAME_ATTRIBUTE]: metadata['vmScaleSetName'],\n [AZURE_VM_SKU_ATTRIBUTE]: metadata['sku'],\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_VM,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_REGION]: metadata['location'],\n [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: metadata['resourceId'],\n [ATTR_HOST_ID]: metadata['vmId'],\n [ATTR_HOST_NAME]: metadata['name'],\n [ATTR_HOST_TYPE]: metadata['vmSize'],\n [ATTR_OS_VERSION]: metadata['version'],\n };\n return attributes;\n } catch (err: any) {\n diag.debug(\n 'AzureVmResourceDetector: not running in an Azure VM:',\n err.message\n );\n return {};\n }\n }\n}\n\nexport const azureVmDetector = new AzureVmResourceDetector();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,0CAA0C,GACrD,yBAAyB,CAAC;AAC5B,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;AACxE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAC/D,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AACxD,MAAM,CAAC,MAAM,sBAAsB,GACjC,+DAA+D,CAAC;AAClE,MAAM,CAAC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE =\n 'azure.app.service.stamp';\nexport const CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = 'cloud.resource_id';\nexport const REGION_NAME = 'REGION_NAME';\nexport const WEBSITE_HOME_STAMPNAME = 'WEBSITE_HOME_STAMPNAME';\nexport const WEBSITE_HOSTNAME = 'WEBSITE_HOSTNAME';\nexport const WEBSITE_INSTANCE_ID = 'WEBSITE_INSTANCE_ID';\nexport const WEBSITE_OWNER_NAME = 'WEBSITE_OWNER_NAME';\nexport const WEBSITE_RESOURCE_GROUP = 'WEBSITE_RESOURCE_GROUP';\nexport const WEBSITE_SITE_NAME = 'WEBSITE_SITE_NAME';\nexport const WEBSITE_SLOT_NAME = 'WEBSITE_SLOT_NAME';\nexport const WEBSITE_SKU = 'WEBSITE_SKU';\n\nexport const FUNCTIONS_VERSION = 'FUNCTIONS_EXTENSION_VERSION';\nexport const FUNCTIONS_MEM_LIMIT = 'WEBSITE_MEMORY_LIMIT_MB';\n\nexport const AZURE_VM_METADATA_HOST = '169.254.169.254';\nexport const AZURE_VM_METADATA_PATH =\n '/metadata/instance/compute?api-version=2021-12-13&format=json';\nexport const AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = 'azure.vm.scaleset.name';\nexport const AZURE_VM_SKU_ATTRIBUTE = 'azure.vm.sku';\n\nexport interface AzureVmMetadata {\n azEnvironment?: string;\n additionalCapabilities?: {\n hibernationEnabled?: string;\n };\n hostGroup?: {\n id?: string;\n };\n host?: {\n id?: string;\n };\n extendedLocation?: {\n type?: string;\n name?: string;\n };\n evictionPolicy?: string;\n isHostCompatibilityLayerVm?: string;\n licenseType?: string;\n location: string;\n name: string;\n offer?: string;\n osProfile?: {\n adminUsername?: string;\n computerName?: string;\n disablePasswordAuthentication?: string;\n };\n osType?: string;\n placementGroupId?: string;\n plan?: {\n name?: string;\n product?: string;\n publisher?: string;\n };\n platformFaultDomain?: string;\n platformSubFaultDomain?: string;\n platformUpdateDomain?: string;\n priority?: string;\n provider?: string;\n publicKeys?: [\n {\n keyData?: string;\n path?: string;\n },\n {\n keyData?: string;\n path?: string;\n }\n ];\n publisher?: string;\n resourceGroupName?: string;\n resourceId: string;\n securityProfile?: {\n secureBootEnabled?: string;\n virtualTpmEnabled?: string;\n encryptionAtHost?: string;\n securityType?: string;\n };\n sku: string;\n storageProfile?: {\n dataDisks?: [\n {\n bytesPerSecondThrottle?: string;\n caching?: string;\n createOption?: string;\n diskCapacityBytes?: string;\n diskSizeGB?: string;\n image?: {\n uri?: string;\n };\n isSharedDisk?: string;\n isUltraDisk?: string;\n lun?: string;\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name: string;\n opsPerSecondThrottle?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n }\n ];\n imageReference?: {\n id?: string;\n offer?: string;\n publisher?: string;\n sku?: string;\n version?: string;\n };\n osDisk?: {\n caching?: string;\n createOption?: string;\n diskSizeGB?: string;\n diffDiskSettings?: {\n option?: string;\n };\n encryptionSettings?: {\n enabled?: string;\n diskEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n secretUrl?: string;\n };\n keyEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n keyUrl?: string;\n };\n };\n image?: {\n uri?: string;\n };\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name?: string;\n osType?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n };\n resourceDisk?: {\n size?: string;\n };\n };\n subscriptionId?: string;\n tags?: string;\n tagsList?: object[];\n customData?: string;\n userData?: string;\n version: string;\n virtualMachineScaleSet?: {\n id?: string;\n };\n vmId: string;\n vmScaleSetName: string;\n vmSize: string;\n zone?: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,0CAA0C,GACrD,yBAAyB,CAAC;AAC5B,MAAM,CAAC,MAAM,oCAAoC,GAAG,mBAAmB,CAAC;AACxE,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AACzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,gBAAgB,GAAG,kBAAkB,CAAC;AACnD,MAAM,CAAC,MAAM,mBAAmB,GAAG,qBAAqB,CAAC;AACzD,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AACvD,MAAM,CAAC,MAAM,sBAAsB,GAAG,wBAAwB,CAAC;AAC/D,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,iBAAiB,GAAG,mBAAmB,CAAC;AACrD,MAAM,CAAC,MAAM,WAAW,GAAG,aAAa,CAAC;AAEzC,MAAM,CAAC,MAAM,iBAAiB,GAAG,6BAA6B,CAAC;AAC/D,MAAM,CAAC,MAAM,mBAAmB,GAAG,yBAAyB,CAAC;AAE7D,MAAM,CAAC,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AACxD,MAAM,CAAC,MAAM,sBAAsB,GACjC,+DAA+D,CAAC;AAClE,MAAM,CAAC,MAAM,iCAAiC,GAAG,wBAAwB,CAAC;AAC1E,MAAM,CAAC,MAAM,sBAAsB,GAAG,cAAc,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE =\n 'azure.app.service.stamp';\nexport const CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = 'cloud.resource_id';\nexport const REGION_NAME = 'REGION_NAME';\nexport const WEBSITE_HOME_STAMPNAME = 'WEBSITE_HOME_STAMPNAME';\nexport const WEBSITE_HOSTNAME = 'WEBSITE_HOSTNAME';\nexport const WEBSITE_INSTANCE_ID = 'WEBSITE_INSTANCE_ID';\nexport const WEBSITE_OWNER_NAME = 'WEBSITE_OWNER_NAME';\nexport const WEBSITE_RESOURCE_GROUP = 'WEBSITE_RESOURCE_GROUP';\nexport const WEBSITE_SITE_NAME = 'WEBSITE_SITE_NAME';\nexport const WEBSITE_SLOT_NAME = 'WEBSITE_SLOT_NAME';\nexport const WEBSITE_SKU = 'WEBSITE_SKU';\n\nexport const FUNCTIONS_VERSION = 'FUNCTIONS_EXTENSION_VERSION';\nexport const FUNCTIONS_MEM_LIMIT = 'WEBSITE_MEMORY_LIMIT_MB';\n\nexport const AZURE_VM_METADATA_HOST = '169.254.169.254';\nexport const AZURE_VM_METADATA_PATH =\n '/metadata/instance/compute?api-version=2021-12-13&format=json';\nexport const AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = 'azure.vm.scaleset.name';\nexport const AZURE_VM_SKU_ATTRIBUTE = 'azure.vm.sku';\n\nexport interface AzureVmMetadata {\n azEnvironment?: string;\n additionalCapabilities?: {\n hibernationEnabled?: string;\n };\n hostGroup?: {\n id?: string;\n };\n host?: {\n id?: string;\n };\n extendedLocation?: {\n type?: string;\n name?: string;\n };\n evictionPolicy?: string;\n isHostCompatibilityLayerVm?: string;\n licenseType?: string;\n location: string;\n name: string;\n offer?: string;\n osProfile?: {\n adminUsername?: string;\n computerName?: string;\n disablePasswordAuthentication?: string;\n };\n osType?: string;\n placementGroupId?: string;\n plan?: {\n name?: string;\n product?: string;\n publisher?: string;\n };\n platformFaultDomain?: string;\n platformSubFaultDomain?: string;\n platformUpdateDomain?: string;\n priority?: string;\n provider?: string;\n publicKeys?: [\n {\n keyData?: string;\n path?: string;\n },\n {\n keyData?: string;\n path?: string;\n },\n ];\n publisher?: string;\n resourceGroupName?: string;\n resourceId: string;\n securityProfile?: {\n secureBootEnabled?: string;\n virtualTpmEnabled?: string;\n encryptionAtHost?: string;\n securityType?: string;\n };\n sku: string;\n storageProfile?: {\n dataDisks?: [\n {\n bytesPerSecondThrottle?: string;\n caching?: string;\n createOption?: string;\n diskCapacityBytes?: string;\n diskSizeGB?: string;\n image?: {\n uri?: string;\n };\n isSharedDisk?: string;\n isUltraDisk?: string;\n lun?: string;\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name: string;\n opsPerSecondThrottle?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n },\n ];\n imageReference?: {\n id?: string;\n offer?: string;\n publisher?: string;\n sku?: string;\n version?: string;\n };\n osDisk?: {\n caching?: string;\n createOption?: string;\n diskSizeGB?: string;\n diffDiskSettings?: {\n option?: string;\n };\n encryptionSettings?: {\n enabled?: string;\n diskEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n secretUrl?: string;\n };\n keyEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n keyUrl?: string;\n };\n };\n image?: {\n uri?: string;\n };\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name?: string;\n osType?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n };\n resourceDisk?: {\n size?: string;\n };\n };\n subscriptionId?: string;\n tags?: string;\n tagsList?: object[];\n customData?: string;\n userData?: string;\n version: string;\n virtualMachineScaleSet?: {\n id?: string;\n };\n vmId: string;\n vmScaleSetName: string;\n vmSize: string;\n zone?: string;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureAppServiceDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureAppServiceDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,oCASkB;AAClB,8EAAwE;AACxE,wCASoB;AACpB,oCAAgE;AAEhE,MAAM,8BAA8B,GAAG;IACrC,CAAC,2BAAiB,CAAC,EAAE,mBAAW;IAChC,CAAC,0CAAgC,CAAC,EAAE,yBAAiB;IACrD,CAAC,sBAAY,CAAC,EAAE,wBAAgB;IAChC,CAAC,kCAAwB,CAAC,EAAE,2BAAmB;IAC/C,CAAC,kDAA0C,CAAC,EAAE,8BAAsB;CACrE,CAAC;AAEF;;;GAGG;AACH,MAAM,uBAAuB;IAC3B,MAAM;QACJ,IAAI,UAAU,GAAG,EAAE,CAAC;QACpB,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,yBAAiB,CAAC,CAAC;QACvD,IAAI,eAAe,IAAI,CAAC,IAAA,uBAAe,GAAE,EAAE;YACzC,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,wCAAiB,CAAC,EAAE,eAAe;aACrC,CAAC;YACF,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,6BAAmB,CAAC,EAAE,oCAA0B;aAClD,CAAC;YACF,UAAU,GAAG;gBACX,GAAG,UAAU;gBACb,CAAC,6BAAmB,CAAC,EAAE,gDAAsC;aAC9D,CAAC;YAEF,MAAM,gBAAgB,GAAG,IAAA,2BAAmB,EAAC,eAAe,CAAC,CAAC;YAC9D,IAAI,gBAAgB,EAAE;gBACpB,UAAU,GAAG;oBACX,GAAG,UAAU;oBACb,GAAG,EAAE,CAAC,4CAAoC,CAAC,EAAE,gBAAgB,EAAE;iBAChE,CAAC;aACH;YAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CACvC,8BAA8B,CAC/B,EAAE;gBACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAClC,IAAI,MAAM,EAAE;oBACV,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport {\n AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE,\n REGION_NAME,\n WEBSITE_HOME_STAMPNAME,\n WEBSITE_HOSTNAME,\n WEBSITE_INSTANCE_ID,\n WEBSITE_SITE_NAME,\n WEBSITE_SLOT_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_CLOUD_REGION,\n ATTR_DEPLOYMENT_ENVIRONMENT_NAME,\n ATTR_HOST_ID,\n ATTR_SERVICE_INSTANCE_ID,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n} from '../semconv';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst APP_SERVICE_ATTRIBUTE_ENV_VARS = {\n [ATTR_CLOUD_REGION]: REGION_NAME,\n [ATTR_DEPLOYMENT_ENVIRONMENT_NAME]: WEBSITE_SLOT_NAME,\n [ATTR_HOST_ID]: WEBSITE_HOSTNAME,\n [ATTR_SERVICE_INSTANCE_ID]: WEBSITE_INSTANCE_ID,\n [AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE]: WEBSITE_HOME_STAMPNAME,\n};\n\n/**\n * The AzureAppServiceDetector can be used to detect if a process is running in an Azure App Service\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureAppServiceDetector implements ResourceDetector {\n detect(): DetectedResource {\n let attributes = {};\n const websiteSiteName = process.env[WEBSITE_SITE_NAME];\n if (websiteSiteName && !isAzureFunction()) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: websiteSiteName,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n };\n\n const azureResourceUri = getAzureResourceUri(websiteSiteName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n APP_SERVICE_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureAppServiceDetector = new AzureAppServiceDetector();\n"]}
1
+ {"version":3,"file":"AzureAppServiceDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureAppServiceDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,oCASkB;AAClB,8E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EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,uBAAuB,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport {\n AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE,\n REGION_NAME,\n WEBSITE_HOME_STAMPNAME,\n WEBSITE_HOSTNAME,\n WEBSITE_INSTANCE_ID,\n WEBSITE_SITE_NAME,\n WEBSITE_SLOT_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_CLOUD_REGION,\n ATTR_DEPLOYMENT_ENVIRONMENT_NAME,\n ATTR_HOST_ID,\n ATTR_SERVICE_INSTANCE_ID,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n} from '../semconv';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst APP_SERVICE_ATTRIBUTE_ENV_VARS = {\n [ATTR_CLOUD_REGION]: REGION_NAME,\n [ATTR_DEPLOYMENT_ENVIRONMENT_NAME]: WEBSITE_SLOT_NAME,\n [ATTR_HOST_ID]: WEBSITE_HOSTNAME,\n [ATTR_SERVICE_INSTANCE_ID]: WEBSITE_INSTANCE_ID,\n [AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE]: WEBSITE_HOME_STAMPNAME,\n};\n\n/**\n * The AzureAppServiceDetector can be used to detect if a process is running in an Azure App Service\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureAppServiceDetector implements ResourceDetector {\n public detect(): DetectedResource {\n let attributes = {};\n const websiteSiteName = process.env[WEBSITE_SITE_NAME];\n if (websiteSiteName && !isAzureFunction()) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: websiteSiteName,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n };\n attributes = {\n ...attributes,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_APP_SERVICE,\n };\n\n const azureResourceUri = getAzureResourceUri(websiteSiteName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n APP_SERVICE_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureAppServiceDetector = new AzureAppServiceDetector();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureFunctionsDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureFunctionsDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAGH,8EAAwE;AACxE,wCASoB;AACpB,oCAMkB;AAClB,oCAAgE;AAEhE,MAAM,kCAAkC,GAAG;IACzC,CAAC,wCAAiB,CAAC,EAAE,yBAAiB;IACtC,CAAC,4BAAkB,CAAC,EAAE,2BAAmB;IACzC,CAAC,8BAAoB,CAAC,EAAE,2BAAmB;CAC5C,CAAC;AAEF;;;GAGG;AACH,MAAM,sBAAsB;IA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MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAClC,IAAI,MAAM,EAAE;oBACV,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_FAAS_MAX_MEMORY,\n ATTR_FAAS_INSTANCE,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n ATTR_CLOUD_REGION,\n ATTR_PROCESS_PID,\n} from '../semconv';\nimport {\n WEBSITE_SITE_NAME,\n WEBSITE_INSTANCE_ID,\n FUNCTIONS_MEM_LIMIT,\n REGION_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS = {\n [ATTR_SERVICE_NAME]: WEBSITE_SITE_NAME,\n [ATTR_FAAS_INSTANCE]: WEBSITE_INSTANCE_ID,\n [ATTR_FAAS_MAX_MEMORY]: FUNCTIONS_MEM_LIMIT,\n};\n\n/**\n * The AzureFunctionsDetector can be used to detect if a process is running in Azure Functions\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureFunctionsDetector implements ResourceDetector {\n detect(): DetectedResource {\n let attributes = {};\n const serviceName = process.env[WEBSITE_SITE_NAME];\n\n /**\n * Checks that we are operating within an Azure Function using the function version since WEBSITE_SITE_NAME\n * will exist in Azure App Service as well and detectors should be mutually exclusive.\n * If the function version is not present, we check for the website sku to determine if it is a function.\n */\n if (serviceName && isAzureFunction()) {\n const functionInstance = process.env[WEBSITE_INSTANCE_ID];\n const functionMemLimit = process.env[FUNCTIONS_MEM_LIMIT];\n\n attributes = {\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n [ATTR_CLOUD_REGION]: process.env[REGION_NAME],\n [ATTR_PROCESS_PID]: process.pid,\n };\n\n if (serviceName) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: serviceName,\n };\n }\n if (functionInstance) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_INSTANCE]: functionInstance,\n };\n }\n if (functionMemLimit) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_MAX_MEMORY]: functionMemLimit,\n };\n }\n const azureResourceUri = getAzureResourceUri(serviceName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureFunctionsDetector = new AzureFunctionsDetector();\n"]}
1
+ {"version":3,"file":"AzureFunctionsDetector.js","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,EAAE,gBAAgB;iBACzC,CAAC;aACH;YACD,MAAM,gBAAgB,GAAG,IAAA,2BAAmB,EAAC,WAAW,CAAC,CAAC;YAC1D,IAAI,gBAAgB,EAAE;gBACpB,UAAU,GAAG;oBACX,GAAG,UAAU;oBACb,GAAG,EAAE,CAAC,4CAAoC,CAAC,EAAE,gBAAgB,EAAE;iBAChE,CAAC;aACH;YAED,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CACvC,kCAAkC,CACnC,EAAE;gBACD,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;gBAClC,IAAI,MAAM,EAAE;oBACV,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;iBACtD;aACF;SACF;QACD,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;CACF;AAEY,QAAA,sBAAsB,GAAG,IAAI,sBAAsB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ResourceDetector, DetectedResource } from '@opentelemetry/resources';\nimport { ATTR_SERVICE_NAME } from '@opentelemetry/semantic-conventions';\nimport {\n ATTR_FAAS_MAX_MEMORY,\n ATTR_FAAS_INSTANCE,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n ATTR_CLOUD_REGION,\n ATTR_PROCESS_PID,\n} from '../semconv';\nimport {\n WEBSITE_SITE_NAME,\n WEBSITE_INSTANCE_ID,\n FUNCTIONS_MEM_LIMIT,\n REGION_NAME,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n} from '../types';\nimport { getAzureResourceUri, isAzureFunction } from '../utils';\n\nconst AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS = {\n [ATTR_SERVICE_NAME]: WEBSITE_SITE_NAME,\n [ATTR_FAAS_INSTANCE]: WEBSITE_INSTANCE_ID,\n [ATTR_FAAS_MAX_MEMORY]: FUNCTIONS_MEM_LIMIT,\n};\n\n/**\n * The AzureFunctionsDetector can be used to detect if a process is running in Azure Functions\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureFunctionsDetector implements ResourceDetector {\n public detect(): DetectedResource {\n let attributes = {};\n const serviceName = process.env[WEBSITE_SITE_NAME];\n\n /**\n * Checks that we are operating within an Azure Function using the function version since WEBSITE_SITE_NAME\n * will exist in Azure App Service as well and detectors should be mutually exclusive.\n * If the function version is not present, we check for the website sku to determine if it is a function.\n */\n if (serviceName && isAzureFunction()) {\n const functionInstance = process.env[WEBSITE_INSTANCE_ID];\n const functionMemLimit = process.env[FUNCTIONS_MEM_LIMIT];\n\n attributes = {\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_FUNCTIONS,\n [ATTR_CLOUD_REGION]: process.env[REGION_NAME],\n [ATTR_PROCESS_PID]: process.pid,\n };\n\n if (serviceName) {\n attributes = {\n ...attributes,\n [ATTR_SERVICE_NAME]: serviceName,\n };\n }\n if (functionInstance) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_INSTANCE]: functionInstance,\n };\n }\n if (functionMemLimit) {\n attributes = {\n ...attributes,\n [ATTR_FAAS_MAX_MEMORY]: functionMemLimit,\n };\n }\n const azureResourceUri = getAzureResourceUri(serviceName);\n if (azureResourceUri) {\n attributes = {\n ...attributes,\n ...{ [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: azureResourceUri },\n };\n }\n\n for (const [key, value] of Object.entries(\n AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS\n )) {\n const envVar = process.env[value];\n if (envVar) {\n attributes = { ...attributes, ...{ [key]: envVar } };\n }\n }\n }\n return { attributes };\n }\n}\n\nexport const azureFunctionsDetector = new AzureFunctionsDetector();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"AzureVmDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureVmDetector.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,6BAA6B;AAE7B,4CAAmD;AACnD,8CAAsD;AAMtD,wCAUoB;AACpB,oCAOkB;AAElB;;;GAGG;AACH,MAAM,uBAAuB;IAC3B,MAAM;QACJ,MAAM,WAAW,GAAG,aAAO,CAAC,IAAI,CAAC,IAAA,sBAAe,EAAC,aAAO,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,CACvE,IAAI,CAAC,kBAAkB,EAAE,CAC1B,CAAC;QAEF,MAAM,SAAS,GAAG;YAChB,yCAAiC;YACjC,8BAAsB;YACtB,6BAAmB;YACnB,6BAAmB;YACnB,2BAAiB;YACjB,4CAAoC;YACpC,sBAAY;YACZ,wBAAc;YACd,wBAAc;YACd,yBAAe;SAChB,CAAC;QAEF,MAAM,UAAU,GAAG,EAAgC,CAAC;QACpD,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YACvB,yEAAyE;YACzE,UAAU,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1D,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,UAAU,EAAE,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,kBAAkB;QACtB,IAAI;YACF,M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C,CAAC,CAAC;gBACH,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE;oBACpB,YAAY,CAAC,SAAS,CAAC,CAAC;oBACxB,MAAM,CAAC,GAAG,CAAC,CAAC;gBACd,CAAC,CAAC,CAAC;gBACH,GAAG,CAAC,GAAG,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;YAEH,MAAM,UAAU,GAAG;gBACjB,CAAC,yCAAiC,CAAC,EAAE,QAAQ,CAAC,gBAAgB,CAAC;gBAC/D,CAAC,8BAAsB,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC;gBACzC,CAAC,6BAAmB,CAAC,EAAE,uCAA6B;gBACpD,CAAC,6BAAmB,CAAC,EAAE,oCAA0B;gBACjD,CAAC,2BAAiB,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;gBACzC,CAAC,4CAAoC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;gBAC9D,CAAC,sBAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAChC,CAAC,wBAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAClC,CAAC,wBAAc,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;gBACpC,CAAC,yBAAe,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;aACvC,CAAC;YACF,OAAO,UAAU,CAAC;SACnB;QAAC,OAAO,GAAQ,EAAE;YACjB,UAAI,CAAC,KAAK,CACR,sDAAsD,EACtD,GAAG,CAAC,OAAO,CACZ,CAAC;YACF,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as http from 'http';\n\nimport { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n} from '@opentelemetry/resources';\nimport {\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_VM,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_REGION,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n} from '../semconv';\nimport {\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n AZURE_VM_METADATA_HOST,\n AZURE_VM_METADATA_PATH,\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n AzureVmMetadata,\n} from '../types';\n\n/**\n * The AzureVmDetector can be used to detect if a process is running in an Azure VM.\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureVmResourceDetector implements ResourceDetector {\n detect(): DetectedResource {\n const dataPromise = context.with(suppressTracing(context.active()), () =>\n this.getAzureVmMetadata()\n );\n\n const attrNames = [\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_REGION,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n ];\n\n const attributes = {} as DetectedResourceAttributes;\n attrNames.forEach(name => {\n // Each resource attribute is determined asynchronously in _gatherData().\n attributes[name] = dataPromise.then(data => data[name]);\n });\n\n return { attributes };\n }\n\n async getAzureVmMetadata(): Promise<DetectedResourceAttributes> {\n try {\n const options = {\n host: AZURE_VM_METADATA_HOST,\n path: AZURE_VM_METADATA_PATH,\n method: 'GET',\n timeout: 5000,\n headers: {\n Metadata: 'True',\n },\n };\n const metadata: AzureVmMetadata = await new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n req.destroy();\n reject(new Error('Azure metadata service request timed out.'));\n }, 1000);\n\n const req = http.request(options, res => {\n clearTimeout(timeoutId);\n const { statusCode } = res;\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', chunk => (rawData += chunk));\n res.on('end', () => {\n if (statusCode && statusCode >= 200 && statusCode < 300) {\n try {\n resolve(JSON.parse(rawData));\n } catch (error) {\n reject(error);\n }\n } else {\n reject(\n new Error('Failed to load page, status code: ' + statusCode)\n );\n }\n });\n });\n req.on('error', err => {\n clearTimeout(timeoutId);\n reject(err);\n });\n req.end();\n });\n\n const attributes = {\n [AZURE_VM_SCALE_SET_NAME_ATTRIBUTE]: metadata['vmScaleSetName'],\n [AZURE_VM_SKU_ATTRIBUTE]: metadata['sku'],\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_VM,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_REGION]: metadata['location'],\n [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: metadata['resourceId'],\n [ATTR_HOST_ID]: metadata['vmId'],\n [ATTR_HOST_NAME]: metadata['name'],\n [ATTR_HOST_TYPE]: metadata['vmSize'],\n [ATTR_OS_VERSION]: metadata['version'],\n };\n return attributes;\n } catch (err: any) {\n diag.debug(\n 'AzureVmResourceDetector: not running in an Azure VM:',\n err.message\n );\n return {};\n }\n }\n}\n\nexport const azureVmDetector = new AzureVmResourceDetector();\n"]}
1
+ {"version":3,"file":"AzureVmDetector.js","sourceRoot":"","sources":["../../../src/detectors/AzureVmDetector.ts"],"names":[],"mappings":";A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E,uCAA6B;gBACpD,CAAC,6BAAmB,CAAC,EAAE,oCAA0B;gBACjD,CAAC,2BAAiB,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC;gBACzC,CAAC,4CAAoC,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC;gBAC9D,CAAC,sBAAY,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAChC,CAAC,wBAAc,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC;gBAClC,CAAC,wBAAc,CAAC,EAAE,QAAQ,CAAC,QAAQ,CAAC;gBACpC,CAAC,yBAAe,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC;aACvC,CAAC;YACF,OAAO,UAAU,CAAC;SACnB;QAAC,OAAO,GAAQ,EAAE;YACjB,UAAI,CAAC,KAAK,CACR,sDAAsD,EACtD,GAAG,CAAC,OAAO,CACZ,CAAC;YACF,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CACF;AAEY,QAAA,eAAe,GAAG,IAAI,uBAAuB,EAAE,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport * as http from 'http';\n\nimport { context, diag } from '@opentelemetry/api';\nimport { suppressTracing } from '@opentelemetry/core';\nimport {\n ResourceDetector,\n DetectedResource,\n DetectedResourceAttributes,\n} from '@opentelemetry/resources';\nimport {\n ATTR_CLOUD_PLATFORM,\n CLOUD_PLATFORM_VALUE_AZURE_VM,\n ATTR_CLOUD_PROVIDER,\n CLOUD_PROVIDER_VALUE_AZURE,\n ATTR_CLOUD_REGION,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n} from '../semconv';\nimport {\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n AZURE_VM_METADATA_HOST,\n AZURE_VM_METADATA_PATH,\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n AzureVmMetadata,\n} from '../types';\n\n/**\n * The AzureVmDetector can be used to detect if a process is running in an Azure VM.\n * @returns a {@link Resource} populated with data about the environment or an empty Resource if detection fails.\n */\nclass AzureVmResourceDetector implements ResourceDetector {\n public detect(): DetectedResource {\n const dataPromise = context.with(suppressTracing(context.active()), () =>\n this.getAzureVmMetadata()\n );\n\n const attrNames = [\n AZURE_VM_SCALE_SET_NAME_ATTRIBUTE,\n AZURE_VM_SKU_ATTRIBUTE,\n ATTR_CLOUD_PLATFORM,\n ATTR_CLOUD_PROVIDER,\n ATTR_CLOUD_REGION,\n CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE,\n ATTR_HOST_ID,\n ATTR_HOST_NAME,\n ATTR_HOST_TYPE,\n ATTR_OS_VERSION,\n ];\n\n const attributes = {} as DetectedResourceAttributes;\n attrNames.forEach(name => {\n // Each resource attribute is determined asynchronously in _gatherData().\n attributes[name] = dataPromise.then(data => data[name]);\n });\n\n return { attributes };\n }\n\n public async getAzureVmMetadata(): Promise<DetectedResourceAttributes> {\n try {\n const options = {\n host: AZURE_VM_METADATA_HOST,\n path: AZURE_VM_METADATA_PATH,\n method: 'GET',\n timeout: 5000,\n headers: {\n Metadata: 'True',\n },\n };\n const metadata: AzureVmMetadata = await new Promise((resolve, reject) => {\n const timeoutId = setTimeout(() => {\n req.destroy();\n reject(new Error('Azure metadata service request timed out.'));\n }, 1000);\n\n const req = http.request(options, res => {\n clearTimeout(timeoutId);\n const { statusCode } = res;\n res.setEncoding('utf8');\n let rawData = '';\n res.on('data', chunk => (rawData += chunk));\n res.on('end', () => {\n if (statusCode && statusCode >= 200 && statusCode < 300) {\n try {\n resolve(JSON.parse(rawData));\n } catch (error) {\n reject(error);\n }\n } else {\n reject(\n new Error('Failed to load page, status code: ' + statusCode)\n );\n }\n });\n });\n req.on('error', err => {\n clearTimeout(timeoutId);\n reject(err);\n });\n req.end();\n });\n\n const attributes = {\n [AZURE_VM_SCALE_SET_NAME_ATTRIBUTE]: metadata['vmScaleSetName'],\n [AZURE_VM_SKU_ATTRIBUTE]: metadata['sku'],\n [ATTR_CLOUD_PLATFORM]: CLOUD_PLATFORM_VALUE_AZURE_VM,\n [ATTR_CLOUD_PROVIDER]: CLOUD_PROVIDER_VALUE_AZURE,\n [ATTR_CLOUD_REGION]: metadata['location'],\n [CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: metadata['resourceId'],\n [ATTR_HOST_ID]: metadata['vmId'],\n [ATTR_HOST_NAME]: metadata['name'],\n [ATTR_HOST_TYPE]: metadata['vmSize'],\n [ATTR_OS_VERSION]: metadata['version'],\n };\n return attributes;\n } catch (err: any) {\n diag.debug(\n 'AzureVmResourceDetector: not running in an Azure VM:',\n err.message\n );\n return {};\n }\n }\n}\n\nexport const azureVmDetector = new AzureVmResourceDetector();\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEU,QAAA,0CAA0C,GACrD,yBAAyB,CAAC;AACf,QAAA,oCAAoC,GAAG,mBAAmB,CAAC;AAC3D,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,WAAW,GAAG,aAAa,CAAC;AAE5B,QAAA,iBAAiB,GAAG,6BAA6B,CAAC;AAClD,QAAA,mBAAmB,GAAG,yBAAyB,CAAC;AAEhD,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,sBAAsB,GACjC,+DAA+D,CAAC;AACrD,QAAA,iCAAiC,GAAG,wBAAwB,CAAC;AAC7D,QAAA,sBAAsB,GAAG,cAAc,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE =\n 'azure.app.service.stamp';\nexport const CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = 'cloud.resource_id';\nexport const REGION_NAME = 'REGION_NAME';\nexport const WEBSITE_HOME_STAMPNAME = 'WEBSITE_HOME_STAMPNAME';\nexport const WEBSITE_HOSTNAME = 'WEBSITE_HOSTNAME';\nexport const WEBSITE_INSTANCE_ID = 'WEBSITE_INSTANCE_ID';\nexport const WEBSITE_OWNER_NAME = 'WEBSITE_OWNER_NAME';\nexport const WEBSITE_RESOURCE_GROUP = 'WEBSITE_RESOURCE_GROUP';\nexport const WEBSITE_SITE_NAME = 'WEBSITE_SITE_NAME';\nexport const WEBSITE_SLOT_NAME = 'WEBSITE_SLOT_NAME';\nexport const WEBSITE_SKU = 'WEBSITE_SKU';\n\nexport const FUNCTIONS_VERSION = 'FUNCTIONS_EXTENSION_VERSION';\nexport const FUNCTIONS_MEM_LIMIT = 'WEBSITE_MEMORY_LIMIT_MB';\n\nexport const AZURE_VM_METADATA_HOST = '169.254.169.254';\nexport const AZURE_VM_METADATA_PATH =\n '/metadata/instance/compute?api-version=2021-12-13&format=json';\nexport const AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = 'azure.vm.scaleset.name';\nexport const AZURE_VM_SKU_ATTRIBUTE = 'azure.vm.sku';\n\nexport interface AzureVmMetadata {\n azEnvironment?: string;\n additionalCapabilities?: {\n hibernationEnabled?: string;\n };\n hostGroup?: {\n id?: string;\n };\n host?: {\n id?: string;\n };\n extendedLocation?: {\n type?: string;\n name?: string;\n };\n evictionPolicy?: string;\n isHostCompatibilityLayerVm?: string;\n licenseType?: string;\n location: string;\n name: string;\n offer?: string;\n osProfile?: {\n adminUsername?: string;\n computerName?: string;\n disablePasswordAuthentication?: string;\n };\n osType?: string;\n placementGroupId?: string;\n plan?: {\n name?: string;\n product?: string;\n publisher?: string;\n };\n platformFaultDomain?: string;\n platformSubFaultDomain?: string;\n platformUpdateDomain?: string;\n priority?: string;\n provider?: string;\n publicKeys?: [\n {\n keyData?: string;\n path?: string;\n },\n {\n keyData?: string;\n path?: string;\n }\n ];\n publisher?: string;\n resourceGroupName?: string;\n resourceId: string;\n securityProfile?: {\n secureBootEnabled?: string;\n virtualTpmEnabled?: string;\n encryptionAtHost?: string;\n securityType?: string;\n };\n sku: string;\n storageProfile?: {\n dataDisks?: [\n {\n bytesPerSecondThrottle?: string;\n caching?: string;\n createOption?: string;\n diskCapacityBytes?: string;\n diskSizeGB?: string;\n image?: {\n uri?: string;\n };\n isSharedDisk?: string;\n isUltraDisk?: string;\n lun?: string;\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name: string;\n opsPerSecondThrottle?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n }\n ];\n imageReference?: {\n id?: string;\n offer?: string;\n publisher?: string;\n sku?: string;\n version?: string;\n };\n osDisk?: {\n caching?: string;\n createOption?: string;\n diskSizeGB?: string;\n diffDiskSettings?: {\n option?: string;\n };\n encryptionSettings?: {\n enabled?: string;\n diskEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n secretUrl?: string;\n };\n keyEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n keyUrl?: string;\n };\n };\n image?: {\n uri?: string;\n };\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name?: string;\n osType?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n };\n resourceDisk?: {\n size?: string;\n };\n };\n subscriptionId?: string;\n tags?: string;\n tagsList?: object[];\n customData?: string;\n userData?: string;\n version: string;\n virtualMachineScaleSet?: {\n id?: string;\n };\n vmId: string;\n vmScaleSetName: string;\n vmSize: string;\n zone?: string;\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEU,QAAA,0CAA0C,GACrD,yBAAyB,CAAC;AACf,QAAA,oCAAoC,GAAG,mBAAmB,CAAC;AAC3D,QAAA,WAAW,GAAG,aAAa,CAAC;AAC5B,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,gBAAgB,GAAG,kBAAkB,CAAC;AACtC,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,kBAAkB,GAAG,oBAAoB,CAAC;AAC1C,QAAA,sBAAsB,GAAG,wBAAwB,CAAC;AAClD,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,iBAAiB,GAAG,mBAAmB,CAAC;AACxC,QAAA,WAAW,GAAG,aAAa,CAAC;AAE5B,QAAA,iBAAiB,GAAG,6BAA6B,CAAC;AAClD,QAAA,mBAAmB,GAAG,yBAAyB,CAAC;AAEhD,QAAA,sBAAsB,GAAG,iBAAiB,CAAC;AAC3C,QAAA,sBAAsB,GACjC,+DAA+D,CAAC;AACrD,QAAA,iCAAiC,GAAG,wBAAwB,CAAC;AAC7D,QAAA,sBAAsB,GAAG,cAAc,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport const AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE =\n 'azure.app.service.stamp';\nexport const CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE = 'cloud.resource_id';\nexport const REGION_NAME = 'REGION_NAME';\nexport const WEBSITE_HOME_STAMPNAME = 'WEBSITE_HOME_STAMPNAME';\nexport const WEBSITE_HOSTNAME = 'WEBSITE_HOSTNAME';\nexport const WEBSITE_INSTANCE_ID = 'WEBSITE_INSTANCE_ID';\nexport const WEBSITE_OWNER_NAME = 'WEBSITE_OWNER_NAME';\nexport const WEBSITE_RESOURCE_GROUP = 'WEBSITE_RESOURCE_GROUP';\nexport const WEBSITE_SITE_NAME = 'WEBSITE_SITE_NAME';\nexport const WEBSITE_SLOT_NAME = 'WEBSITE_SLOT_NAME';\nexport const WEBSITE_SKU = 'WEBSITE_SKU';\n\nexport const FUNCTIONS_VERSION = 'FUNCTIONS_EXTENSION_VERSION';\nexport const FUNCTIONS_MEM_LIMIT = 'WEBSITE_MEMORY_LIMIT_MB';\n\nexport const AZURE_VM_METADATA_HOST = '169.254.169.254';\nexport const AZURE_VM_METADATA_PATH =\n '/metadata/instance/compute?api-version=2021-12-13&format=json';\nexport const AZURE_VM_SCALE_SET_NAME_ATTRIBUTE = 'azure.vm.scaleset.name';\nexport const AZURE_VM_SKU_ATTRIBUTE = 'azure.vm.sku';\n\nexport interface AzureVmMetadata {\n azEnvironment?: string;\n additionalCapabilities?: {\n hibernationEnabled?: string;\n };\n hostGroup?: {\n id?: string;\n };\n host?: {\n id?: string;\n };\n extendedLocation?: {\n type?: string;\n name?: string;\n };\n evictionPolicy?: string;\n isHostCompatibilityLayerVm?: string;\n licenseType?: string;\n location: string;\n name: string;\n offer?: string;\n osProfile?: {\n adminUsername?: string;\n computerName?: string;\n disablePasswordAuthentication?: string;\n };\n osType?: string;\n placementGroupId?: string;\n plan?: {\n name?: string;\n product?: string;\n publisher?: string;\n };\n platformFaultDomain?: string;\n platformSubFaultDomain?: string;\n platformUpdateDomain?: string;\n priority?: string;\n provider?: string;\n publicKeys?: [\n {\n keyData?: string;\n path?: string;\n },\n {\n keyData?: string;\n path?: string;\n },\n ];\n publisher?: string;\n resourceGroupName?: string;\n resourceId: string;\n securityProfile?: {\n secureBootEnabled?: string;\n virtualTpmEnabled?: string;\n encryptionAtHost?: string;\n securityType?: string;\n };\n sku: string;\n storageProfile?: {\n dataDisks?: [\n {\n bytesPerSecondThrottle?: string;\n caching?: string;\n createOption?: string;\n diskCapacityBytes?: string;\n diskSizeGB?: string;\n image?: {\n uri?: string;\n };\n isSharedDisk?: string;\n isUltraDisk?: string;\n lun?: string;\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name: string;\n opsPerSecondThrottle?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n },\n ];\n imageReference?: {\n id?: string;\n offer?: string;\n publisher?: string;\n sku?: string;\n version?: string;\n };\n osDisk?: {\n caching?: string;\n createOption?: string;\n diskSizeGB?: string;\n diffDiskSettings?: {\n option?: string;\n };\n encryptionSettings?: {\n enabled?: string;\n diskEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n secretUrl?: string;\n };\n keyEncryptionKey?: {\n sourceVault?: {\n id?: string;\n };\n keyUrl?: string;\n };\n };\n image?: {\n uri?: string;\n };\n managedDisk?: {\n id?: string;\n storageAccountType?: string;\n };\n name?: string;\n osType?: string;\n vhd?: {\n uri?: string;\n };\n writeAcceleratorEnabled?: string;\n };\n resourceDisk?: {\n size?: string;\n };\n };\n subscriptionId?: string;\n tags?: string;\n tagsList?: object[];\n customData?: string;\n userData?: string;\n version: string;\n virtualMachineScaleSet?: {\n id?: string;\n };\n vmId: string;\n vmScaleSetName: string;\n vmSize: string;\n zone?: string;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentelemetry/resource-detector-azure",
3
- "version": "0.15.0",
3
+ "version": "0.17.0",
4
4
  "description": "OpenTelemetry SDK resource detector for Azure",
5
5
  "main": "build/src/index.js",
6
6
  "module": "build/esm/index.js",
@@ -37,16 +37,9 @@
37
37
  },
38
38
  "devDependencies": {
39
39
  "@opentelemetry/api": "^1.0.0",
40
- "@opentelemetry/contrib-test-utils": "^0.54.0",
41
- "@opentelemetry/instrumentation-http": "^0.207.0",
42
- "@opentelemetry/sdk-trace-base": "^2.0.0",
43
- "@types/mocha": "10.0.10",
44
- "@types/node": "18.18.14",
45
- "@types/sinon": "17.0.4",
46
- "nock": "13.3.3",
47
- "nyc": "17.1.0",
48
- "rimraf": "5.0.10",
49
- "typescript": "5.0.4"
40
+ "@opentelemetry/contrib-test-utils": "^0.56.0",
41
+ "@opentelemetry/instrumentation-http": "^0.208.0",
42
+ "@opentelemetry/sdk-trace-base": "^2.0.0"
50
43
  },
51
44
  "peerDependencies": {
52
45
  "@opentelemetry/api": "^1.0.0"
@@ -58,5 +51,5 @@
58
51
  },
59
52
  "homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/packages/resource-detector-azure#readme",
60
53
  "sideEffects": false,
61
- "gitHead": "2801ab2f0f9243b154a624298dacb7228c4f70cd"
54
+ "gitHead": "66935ac724cc271f70028035e534d47a4dfbcf12"
62
55
  }