From 5f639a5426245077fba73252cd437847274d0aca Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 28 Aug 2026 16:18:44 +0100 Subject: [PATCH 1/4] [Resources.Azure] Update Azure attribute values React to changes made in v1.35.0 of the semantic conventions: - Update `azure_app_service` to `azure.app_service`. - Update `azure_vm` to `azure.vm`. - Update `azure_container_apps` to `azure.container_apps`. --- src/OpenTelemetry.Resources.Azure/CHANGELOG.md | 7 +++++++ src/OpenTelemetry.Resources.Azure/README.md | 6 +++--- .../ResourceAttributeConstants.cs | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/OpenTelemetry.Resources.Azure/CHANGELOG.md b/src/OpenTelemetry.Resources.Azure/CHANGELOG.md index a3577c8bd4..3f3b75c24d 100644 --- a/src/OpenTelemetry.Resources.Azure/CHANGELOG.md +++ b/src/OpenTelemetry.Resources.Azure/CHANGELOG.md @@ -2,6 +2,13 @@ ## Unreleased +* Updated the following attributes values for the `cloud.platform` attribute to + comply with v1.43 of the OpenTelemetry Semantic Conventions: + * `azure_app_service` to `azure.app_service` + * `azure_container_apps` to `azure.container_apps` + * `azure_vm` to `azure.vm` + ([#TODO](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/TODO)) + ## 1.18.0-beta.1 Released 2026-Aug-21 diff --git a/src/OpenTelemetry.Resources.Azure/README.md b/src/OpenTelemetry.Resources.Azure/README.md index 8a8211d3cc..538acdc85a 100644 --- a/src/OpenTelemetry.Resources.Azure/README.md +++ b/src/OpenTelemetry.Resources.Azure/README.md @@ -51,7 +51,7 @@ using var loggerFactory = LoggerFactory.Create(builder => | Attribute | Description | | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | azure.app.service.stamp | The specific "stamp" cluster within Azure where the App Service is running, e.g., "waws-prod-sn1-001". | -| cloud.platform | The cloud platform. Here, it's always "azure_app_service". | +| 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. | @@ -84,7 +84,7 @@ using var meterProvider = Sdk.CreateMeterProviderBuilder() | Attribute | Description | | ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | azure.vm.scaleset.name | The name of the Virtual Machine Scale Set if the VM is part of one. | -| cloud.platform | The cloud platform, which is always set to "azure_vm" in this context. | +| 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}". | @@ -118,7 +118,7 @@ using var meterProvider = Sdk.CreateMeterProviderBuilder() | Attribute | Description | | ------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| cloud.platform | The cloud platform. Here, it's always "azure_container_apps". | +| cloud.platform | The cloud platform. Here, it's always "azure.container_apps". | | cloud.provider | The cloud service provider. In this context, it's always "azure". | | service.instance.id | Represents the specific instance ID of Azure Container Apps, useful in scaled-out configurations. | | service.name | The name of the Azure Container Apps or Azure Container Apps job. | diff --git a/src/OpenTelemetry.Resources.Azure/ResourceAttributeConstants.cs b/src/OpenTelemetry.Resources.Azure/ResourceAttributeConstants.cs index 25c1393de1..134abd9681 100644 --- a/src/OpenTelemetry.Resources.Azure/ResourceAttributeConstants.cs +++ b/src/OpenTelemetry.Resources.Azure/ResourceAttributeConstants.cs @@ -31,8 +31,8 @@ internal sealed class ResourceAttributeConstants internal const string AzureContainerAppJobExecutionNameEnvVar = "CONTAINER_APP_JOB_EXECUTION_NAME"; // Azure resource attributes constant values - internal const string AzureAppServicePlatformValue = "azure_app_service"; + internal const string AzureAppServicePlatformValue = "azure.app_service"; internal const string AzureCloudProviderValue = "azure"; - internal const string AzureVmCloudPlatformValue = "azure_vm"; - internal const string AzureContainerAppsPlatformValue = "azure_container_apps"; + internal const string AzureVmCloudPlatformValue = "azure.vm"; + internal const string AzureContainerAppsPlatformValue = "azure.container_apps"; } From 18a6c0a722d9af5ef662f85f7268deb6542df46b Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Fri, 28 Aug 2026 16:23:32 +0100 Subject: [PATCH 2/4] [Resources.Azure] Update CHANGELOG Add PR number. --- src/OpenTelemetry.Resources.Azure/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenTelemetry.Resources.Azure/CHANGELOG.md b/src/OpenTelemetry.Resources.Azure/CHANGELOG.md index 3f3b75c24d..b7956a92f1 100644 --- a/src/OpenTelemetry.Resources.Azure/CHANGELOG.md +++ b/src/OpenTelemetry.Resources.Azure/CHANGELOG.md @@ -3,11 +3,11 @@ ## Unreleased * Updated the following attributes values for the `cloud.platform` attribute to - comply with v1.43 of the OpenTelemetry Semantic Conventions: + comply with v1.43.0 of the OpenTelemetry Semantic Conventions: * `azure_app_service` to `azure.app_service` * `azure_container_apps` to `azure.container_apps` * `azure_vm` to `azure.vm` - ([#TODO](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/TODO)) + ([#5143](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/5143)) ## 1.18.0-beta.1 From 5ba67bef19ea8743fd0837d1a7f70944bf285477 Mon Sep 17 00:00:00 2001 From: Martin Costello Date: Fri, 28 Aug 2026 16:30:52 +0100 Subject: [PATCH 3/4] [Resources.Azure] Fix typo Update CHANGELOG grammar. --- src/OpenTelemetry.Resources.Azure/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenTelemetry.Resources.Azure/CHANGELOG.md b/src/OpenTelemetry.Resources.Azure/CHANGELOG.md index b7956a92f1..1fd0e97823 100644 --- a/src/OpenTelemetry.Resources.Azure/CHANGELOG.md +++ b/src/OpenTelemetry.Resources.Azure/CHANGELOG.md @@ -2,7 +2,7 @@ ## Unreleased -* Updated the following attributes values for the `cloud.platform` attribute to +* Updated the following values for the `cloud.platform` attribute to comply with v1.43.0 of the OpenTelemetry Semantic Conventions: * `azure_app_service` to `azure.app_service` * `azure_container_apps` to `azure.container_apps` From e82f176e5e8158927cfc6c2e4c388249f60a8c2b Mon Sep 17 00:00:00 2001 From: martincostello Date: Fri, 28 Aug 2026 16:57:56 +0100 Subject: [PATCH 4/4] [Resources.Azure] Address feedback Do not re-use the same constants as the production code. --- .../AzureResourceDetectorTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/test/OpenTelemetry.Resources.Azure.Tests/AzureResourceDetectorTests.cs b/test/OpenTelemetry.Resources.Azure.Tests/AzureResourceDetectorTests.cs index f7e95157ed..179006cd8b 100644 --- a/test/OpenTelemetry.Resources.Azure.Tests/AzureResourceDetectorTests.cs +++ b/test/OpenTelemetry.Resources.Azure.Tests/AzureResourceDetectorTests.cs @@ -106,6 +106,7 @@ public void AppServiceResourceDetectorReturnsResourceWithAttributes() var expectedResourceUri = "/subscriptions/testtestSubscriptionId/resourceGroups/testResourceGroup/providers/Microsoft.Web/sites/sitename"; Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeCloudResourceId, expectedResourceUri), resource.Attributes); Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeServiceName, "sitename"), resource.Attributes); + Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeCloudPlatform, "azure.app_service"), resource.Attributes); foreach (var kvp in AppServiceResourceDetector.AppServiceResourceAttributes) { @@ -145,7 +146,7 @@ public void TestAzureVmResourceDetector() var expectedValue = field switch { ResourceSemanticConventions.AttributeServiceInstance => new KeyValuePair(field, ResourceSemanticConventions.AttributeHostId), - ResourceSemanticConventions.AttributeCloudPlatform => new KeyValuePair(field, ResourceAttributeConstants.AzureVmCloudPlatformValue), + ResourceSemanticConventions.AttributeCloudPlatform => new KeyValuePair(field, "azure.vm"), ResourceSemanticConventions.AttributeCloudProvider => new KeyValuePair(field, ResourceAttributeConstants.AzureCloudProviderValue), _ => new KeyValuePair(field, field), }; @@ -184,6 +185,7 @@ public void AzureContainerAppsResourceDetectorReturnsResourceWithAttributes() Assert.StartsWith("https://opentelemetry.io/schemas/", resource.SchemaUrl); Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeServiceName, "containerAppName"), resource.Attributes); + Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeCloudPlatform, "azure.container_apps"), resource.Attributes); foreach (var kvp in AzureContainerAppsResourceDetector.AzureContainerAppResourceAttributes) { @@ -212,6 +214,7 @@ public void AzureContainerAppsJobResourceDetectorReturnsResourceWithAttributes() Assert.StartsWith("https://opentelemetry.io/schemas/", resource.SchemaUrl); Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeServiceName, "containerAppJobName"), resource.Attributes); + Assert.Contains(new KeyValuePair(ResourceSemanticConventions.AttributeCloudPlatform, "azure.container_apps"), resource.Attributes); foreach (var kvp in AzureContainerAppsResourceDetector.AzureContainerAppJobResourceAttributes) {