Socket
Socket
Sign inDemoInstall

@opentelemetry/resource-detector-azure

Package Overview
Dependencies
Maintainers
3
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opentelemetry/resource-detector-azure - npm Package Compare versions

Comparing version 0.2.6 to 0.2.7

14

build/src/detectors/AzureAppServiceDetector.js

@@ -23,6 +23,6 @@ "use strict";

const APP_SERVICE_ATTRIBUTE_ENV_VARS = {
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_REGION]: types_1.REGION_NAME,
[semantic_conventions_1.SemanticResourceAttributes.DEPLOYMENT_ENVIRONMENT]: types_1.WEBSITE_SLOT_NAME,
[semantic_conventions_1.SemanticResourceAttributes.HOST_ID]: types_1.WEBSITE_HOSTNAME,
[semantic_conventions_1.SemanticResourceAttributes.SERVICE_INSTANCE_ID]: types_1.WEBSITE_INSTANCE_ID,
[semantic_conventions_1.SEMRESATTRS_CLOUD_REGION]: types_1.REGION_NAME,
[semantic_conventions_1.SEMRESATTRS_DEPLOYMENT_ENVIRONMENT]: types_1.WEBSITE_SLOT_NAME,
[semantic_conventions_1.SEMRESATTRS_HOST_ID]: types_1.WEBSITE_HOSTNAME,
[semantic_conventions_1.SEMRESATTRS_SERVICE_INSTANCE_ID]: types_1.WEBSITE_INSTANCE_ID,
[types_1.AZURE_APP_SERVICE_STAMP_RESOURCE_ATTRIBUTE]: types_1.WEBSITE_HOME_STAMPNAME,

@@ -40,5 +40,5 @@ };

if (websiteSiteName && !isAzureFunction) {
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.SERVICE_NAME]: websiteSiteName });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.CLOUD_PROVIDER]: semantic_conventions_1.CloudProviderValues.AZURE });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.CLOUD_PLATFORM]: semantic_conventions_1.CloudPlatformValues.AZURE_APP_SERVICE });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_SERVICE_NAME]: websiteSiteName });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_CLOUD_PROVIDER]: semantic_conventions_1.CLOUDPROVIDERVALUES_AZURE });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_CLOUD_PLATFORM]: semantic_conventions_1.CLOUDPLATFORMVALUES_AZURE_APP_SERVICE });
const azureResourceUri = this.getAzureResourceUri(websiteSiteName);

@@ -45,0 +45,0 @@ if (azureResourceUri) {

@@ -23,6 +23,6 @@ "use strict";

const AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS = {
[semantic_conventions_1.SemanticResourceAttributes.FAAS_NAME]: types_1.WEBSITE_SITE_NAME,
[semantic_conventions_1.SemanticResourceAttributes.FAAS_VERSION]: types_1.FUNCTIONS_VERSION,
[semantic_conventions_1.SemanticResourceAttributes.FAAS_INSTANCE]: types_1.WEBSITE_INSTANCE_ID,
[semantic_conventions_1.SemanticResourceAttributes.FAAS_MAX_MEMORY]: types_1.FUNCTIONS_MEM_LIMIT,
[semantic_conventions_1.SEMRESATTRS_FAAS_NAME]: types_1.WEBSITE_SITE_NAME,
[semantic_conventions_1.SEMRESATTRS_FAAS_VERSION]: types_1.FUNCTIONS_VERSION,
[semantic_conventions_1.SEMRESATTRS_FAAS_INSTANCE]: types_1.WEBSITE_INSTANCE_ID,
[semantic_conventions_1.SEMRESATTRS_FAAS_MAX_MEMORY]: types_1.FUNCTIONS_MEM_LIMIT,
};

@@ -42,17 +42,17 @@ /**

attributes = {
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_PROVIDER]: semantic_conventions_1.CloudProviderValues.AZURE,
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_PLATFORM]: semantic_conventions_1.CloudPlatformValues.AZURE_FUNCTIONS,
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_REGION]: process.env[types_1.REGION_NAME],
[semantic_conventions_1.SEMRESATTRS_CLOUD_PROVIDER]: semantic_conventions_1.CLOUDPROVIDERVALUES_AZURE,
[semantic_conventions_1.SEMRESATTRS_CLOUD_PLATFORM]: semantic_conventions_1.CLOUDPLATFORMVALUES_AZURE_FUNCTIONS,
[semantic_conventions_1.SEMRESATTRS_CLOUD_REGION]: process.env[types_1.REGION_NAME],
};
if (functionName) {
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.FAAS_NAME]: functionName });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_FAAS_NAME]: functionName });
}
if (functionVersion) {
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.FAAS_VERSION]: functionVersion });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_FAAS_VERSION]: functionVersion });
}
if (functionInstance) {
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.FAAS_INSTANCE]: functionInstance });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_FAAS_INSTANCE]: functionInstance });
}
if (functionMemLimit) {
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SemanticResourceAttributes.FAAS_MAX_MEMORY]: functionMemLimit });
attributes = Object.assign(Object.assign({}, attributes), { [semantic_conventions_1.SEMRESATTRS_FAAS_MAX_MEMORY]: functionMemLimit });
}

@@ -59,0 +59,0 @@ for (const [key, value] of Object.entries(AZURE_FUNCTIONS_ATTRIBUTE_ENV_VARS)) {

@@ -75,10 +75,10 @@ "use strict";

[types_1.AZURE_VM_SKU_ATTRIBUTE]: metadata['sku'],
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_PLATFORM]: semantic_conventions_1.CloudPlatformValues.AZURE_VM,
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_PROVIDER]: semantic_conventions_1.CloudProviderValues.AZURE,
[semantic_conventions_1.SemanticResourceAttributes.CLOUD_REGION]: metadata['location'],
[semantic_conventions_1.SEMRESATTRS_CLOUD_PLATFORM]: semantic_conventions_1.CLOUDPLATFORMVALUES_AZURE_VM,
[semantic_conventions_1.SEMRESATTRS_CLOUD_PROVIDER]: semantic_conventions_1.CLOUDPROVIDERVALUES_AZURE,
[semantic_conventions_1.SEMRESATTRS_CLOUD_REGION]: metadata['location'],
[types_1.CLOUD_RESOURCE_ID_RESOURCE_ATTRIBUTE]: metadata['resourceId'],
[semantic_conventions_1.SemanticResourceAttributes.HOST_ID]: metadata['vmId'],
[semantic_conventions_1.SemanticResourceAttributes.HOST_NAME]: metadata['name'],
[semantic_conventions_1.SemanticResourceAttributes.HOST_TYPE]: metadata['vmSize'],
[semantic_conventions_1.SemanticResourceAttributes.OS_VERSION]: metadata['version'],
[semantic_conventions_1.SEMRESATTRS_HOST_ID]: metadata['vmId'],
[semantic_conventions_1.SEMRESATTRS_HOST_NAME]: metadata['name'],
[semantic_conventions_1.SEMRESATTRS_HOST_TYPE]: metadata['vmSize'],
[semantic_conventions_1.SEMRESATTRS_OS_VERSION]: metadata['version'],
};

@@ -85,0 +85,0 @@ return attributes;

{
"name": "@opentelemetry/resource-detector-azure",
"version": "0.2.6",
"version": "0.2.7",
"description": "OpenTelemetry SDK resource detector for Azure",

@@ -35,3 +35,3 @@ "main": "build/src/index.js",

"@opentelemetry/api": "^1.0.0",
"@opentelemetry/contrib-test-utils": "^0.38.0",
"@opentelemetry/contrib-test-utils": "^0.39.0",
"@types/mocha": "8.2.3",

@@ -52,6 +52,6 @@ "@types/node": "18.6.5",

"@opentelemetry/resources": "^1.10.1",
"@opentelemetry/semantic-conventions": "^1.0.0"
"@opentelemetry/semantic-conventions": "^1.22.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/detectors/node/opentelemetry-resource-detector-azure#readme",
"gitHead": "17a0bc1da3baa472ba9b867eee3c60730cc130fb"
"gitHead": "96a87b48934f0afcf1fe637eed6704f35bd8e973"
}

@@ -30,44 +30,44 @@ # OpenTelemetry Resource Detector for Azure

This package implements Semantic Convention [Version 1.19.0](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.19.0/semantic_conventions/README.md).
### App Service Resource Detector
| Attribute | Description |
| Resource Attribute | Description |
|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| azure.app.service.stamp | The specific "stamp" cluster within Azure where the App Service is running, e.g., "waws-prod-sn1-001". |
| 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`. |
| cloud.platform | The cloud platform. Here, it's always "azure_app_service". |
| cloud.provider | The cloud service provider. In this context, it's always "azure". |
| cloud.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}". |
| cloud.region | The Azure region where the App Service is hosted, e.g., "East US", "West Europe", etc. |
| deployment.environment | The deployment slot where the Azure App Service is running, such as "staging", "production", etc. |
| host.id | The primary hostname for the app, excluding any custom hostnames. |
| service.instance.id | The specific instance of the Azure App Service, useful in a scaled-out configuration. |
| service.name | The name of the Azure App Service. |
| 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`. |
| 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}`. |
| deployment.environment | The deployment slot where the Azure App Service is running, such as "staging", "production", etc. Value of Process Environment Variable `WEBSITE_SLOT_NAME`. |
| host.id | The primary hostname for the app, excluding any custom hostnames. Value of Process Environment Variable `WEBSITE_HOSTNAME`. |
| 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`. |
| service.name | The name of the Azure App Service. Value of Process Environment Variable `WEBSITE_SITE_NAME`. |
### VM Resource Detector
| Attribute | Description |
|--------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| azure.vm.scaleset.name | The name of the Virtual Machine Scale Set if the VM is part of one. |
| 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". |
| cloud.platform | The cloud platform, which is always set to "azure_vm" in this context. |
| cloud.provider | The cloud service provider, which is always set to "azure" in this context. |
| cloud.region | The Azure region where the Virtual Machine is hosted, such as "East US", "West Europe", etc. |
| 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}". |
| host.id | A unique identifier for the VM host, for instance, "02aab8a4-74ef-476e-8182-f6d2ba4166a6". |
| host.name | The name of the host machine. |
| host.type | The size of the VM instance, for example, "Standard_D2s_v3". |
| os.type | The type of operating system running on the VM, such as "Linux" or "Windows". |
| os.version | The version of the operating system running on the VM. |
| service.instance.id | An identifier for a specific instance of the service running on the Azure VM, for example, "02aab8a4-74ef-476e-8182-f6d2ba4166a6". |
| Resource Attribute | Description |
|--------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| azure.vm.scaleset.name | The name of the Virtual Machine Scale Set if the VM is part of one. Value from `vmScaleSetName` key on `/metadata/instance/compute` request. |
| 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. |
| cloud.platform | The cloud platform, which is always set to "azure_vm" in this context. |
| cloud.provider | The cloud service provider, which is always set to "azure" in this context. |
| cloud.region | The Azure region where the Virtual Machine is hosted, such as "East US", "West Europe", etc. Value from `location` key on `/metadata/instance/compute` request. |
| 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.|
| 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. |
| host.name | The name of the host machine. Value from `name` key on `/metadata/instance/compute` request. |
| host.type | The size of the VM instance, for example, "Standard_D2s_v3". Value from `vmSize` key on `/metadata/instance/compute` request. |
| os.version | The version of the operating system running on the VM. Value from `version` key on `/metadata/instance/compute` request. |
### Azure Functions Resource Detector
| Attribute | Description |
|-------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| cloud.platform | The cloud platform. Here, it's always "azure_functions". |
| cloud.provider | The cloud service provider. In this context, it's always "azure". |
| cloud.region | The Azure region where the Azure Function is hosted, e.g., "East US", "West Europe", etc. |
| faas.instance | The specific instance of the Azure App Service, useful in a scaled-out configuration. |
| faas.name | The name of the Azure App Service. |
| faas.version | The version of the Azure Function being executed, e.g., "~4". |
| faas.max_memory | The amount of memory available to the Azure Function expressed in MiB. |
| Resource Attribute | Description |
|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|
| cloud.platform | The cloud platform. Here, it's always "azure_functions". |
| cloud.provider | The cloud service provider. In this context, it's always "azure". |
| cloud.region | The Azure region where the Azure Function is hosted, e.g., "East US", "West Europe", etc. Value of Process Environment Variable `REGION_NAME`. |
| faas.instance | The specific instance of the Azure App Service, useful in a scaled-out configuration. Value from Process Environment Variable `WEBSITE_INSTANCE_ID`. |
| faas.max_memory | The amount of memory available to the Azure Function expressed in MiB. value from Process Environment Variable `WEBSITE_MEMORY_LIMIT_MB`. |
| faas.name | The name of the Azure App Service. Value from Process Environment Variable `WEBSITE_SITE_NAME`. |
| faas.version | The version of the Azure Function being executed, e.g., "~4". value from Process Environment Variable `FUNCTIONS_EXTENSION_VERSION`. |

@@ -74,0 +74,0 @@ ## Useful links

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc