Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/OpenTelemetry.Resources.Azure/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@
App Service resource detector.
([#5138](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/5138))

* 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`
* `azure_vm` to `azure.vm`
([#5143](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/pull/5143))

## 1.18.0-beta.1

Released 2026-Aug-21
Expand Down
6 changes: 3 additions & 3 deletions src/OpenTelemetry.Resources.Azure/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ using var loggerFactory = LoggerFactory.Create(builder =>
| azure.app.service.stamp | The specific "stamp" cluster within Azure where the App Service is running, e.g., "waws-prod-sn1-001". |
| azure.resource_group.name | The Azure resource group from `WEBSITE_RESOURCE_GROUP`. Emitted when the environment variable is non-empty. |
| cloud.account.id | The Azure subscription ID parsed from `WEBSITE_OWNER_NAME`. Emitted when the environment variable is non-empty. |
| 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. |
Expand Down Expand Up @@ -86,7 +86,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}". |
Expand Down Expand Up @@ -120,7 +120,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. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,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";
Comment thread
martincostello marked this conversation as resolved.
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ public void AppServiceResourceDetectorReturnsResourceWithAttributes()
Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeCloudResourceId, expectedResourceUri), resource.Attributes);
Assert.Contains(new KeyValuePair<string, object>(ResourceAttributeConstants.AzureResourceGroupName, "testResourceGroup"), resource.Attributes);
Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeServiceName, "sitename"), resource.Attributes);
Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeCloudPlatform, "azure.app_service"), resource.Attributes);

foreach (var kvp in AppServiceResourceDetector.AppServiceResourceAttributes)
{
Expand Down Expand Up @@ -183,7 +184,7 @@ public void TestAzureVmResourceDetector()
var expectedValue = field switch
{
ResourceSemanticConventions.AttributeServiceInstance => new KeyValuePair<string, object>(field, ResourceSemanticConventions.AttributeHostId),
ResourceSemanticConventions.AttributeCloudPlatform => new KeyValuePair<string, object>(field, ResourceAttributeConstants.AzureVmCloudPlatformValue),
ResourceSemanticConventions.AttributeCloudPlatform => new KeyValuePair<string, object>(field, "azure.vm"),
ResourceSemanticConventions.AttributeCloudProvider => new KeyValuePair<string, object>(field, ResourceAttributeConstants.AzureCloudProviderValue),
_ => new KeyValuePair<string, object>(field, field),
};
Expand Down Expand Up @@ -222,6 +223,7 @@ public void AzureContainerAppsResourceDetectorReturnsResourceWithAttributes()
Assert.StartsWith("https://opentelemetry.io/schemas/", resource.SchemaUrl);

Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeServiceName, "containerAppName"), resource.Attributes);
Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeCloudPlatform, "azure.container_apps"), resource.Attributes);

foreach (var kvp in AzureContainerAppsResourceDetector.AzureContainerAppResourceAttributes)
{
Expand Down Expand Up @@ -250,6 +252,7 @@ public void AzureContainerAppsJobResourceDetectorReturnsResourceWithAttributes()
Assert.StartsWith("https://opentelemetry.io/schemas/", resource.SchemaUrl);

Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeServiceName, "containerAppJobName"), resource.Attributes);
Assert.Contains(new KeyValuePair<string, object>(ResourceSemanticConventions.AttributeCloudPlatform, "azure.container_apps"), resource.Attributes);

foreach (var kvp in AzureContainerAppsResourceDetector.AzureContainerAppJobResourceAttributes)
{
Expand Down