Skip to content

Add Azure App Service account and resource group attributes - #3074

Open
Lewis-E wants to merge 3 commits into
open-telemetry:mainfrom
Lewis-E:fix-azure-app-service-resource-attributes
Open

Add Azure App Service account and resource group attributes#3074
Lewis-E wants to merge 3 commits into
open-telemetry:mainfrom
Lewis-E:fix-azure-app-service-resource-attributes

Conversation

@Lewis-E

@Lewis-E Lewis-E commented Aug 27, 2026

Copy link
Copy Markdown

Description:

Update the Azure App Service resource detector to emit:

  • cloud.account.id - from WEBSITE_OWNER_NAME [sem-conv]
  • azure.resource_group.name - from WEBSITE_RESOURCE_GROUP [sem-conv]

Updated resourceUri to take the above values as parameters.

Goal: Align the Java detector with the Azure App Service mapping tracked in collector-contrib #49616 and implemented for the Collector in collector-contrib #50287.

AI Disclosure: Pi Coding Agent was used to draft this PR, but I wrote this PR description and can explain all changes.

Existing Issue(s): n/a

Testing:

  • Unit Tests
  • Added assertions for the standalone account and resource-group attributes.
  • Added coverage for parsing the subscription ID before + in WEBSITE_OWNER_NAME.
  • Added coverage for independently missing owner and resource-group values.
  • Deployed a test app & confirmed the correct attributes were detected.
Screenshot 2026-08-28 at 2 19 53 PM

Documentation:

This aligns the existing detector with the canonical Azure App Service resource attribute map.

Outstanding items:

Did not change cloud.platform from azure_app_service to azure.app_service even though that is the current convention per open-telemetry/semantic-conventions#1698

Signed-off-by: E. Lewis <7704925+Lewis-E@users.noreply.github.com>
@github-actions
github-actions Bot requested review from trask and zeitlinger August 27, 2026 19:22
Signed-off-by: E. Lewis <7704925+Lewis-E@users.noreply.github.com>
@Lewis-E
Lewis-E marked this pull request as ready for review August 28, 2026 18:32
@Lewis-E
Lewis-E requested a review from a team as a code owner August 28, 2026 18:32
Copilot AI lite review requested due to automatic review settings August 28, 2026 18:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates the Azure App Service resource detector in azure-resources to emit additional semantic convention attributes for Azure App Service environments, aligning the Java implementation with the Azure App Service resource attribute mapping used in OpenTelemetry Collector Contrib.

Changes:

  • Emit cloud.account.id derived from WEBSITE_OWNER_NAME (including parsing the subscription ID before + when present).
  • Emit azure.resource_group.name derived from WEBSITE_RESOURCE_GROUP.
  • Refactor resourceUri construction to accept resource group and subscription ID as parameters, and expand unit test coverage for missing/parsed values.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/AzureAppServiceResourceProvider.java Adds cloud.account.id and azure.resource_group.name emission and refactors resource ID creation to use explicit subscription/resource-group inputs.
azure-resources/src/main/java/io/opentelemetry/contrib/azure/resource/IncubatingAttributes.java Adds internal AttributeKey definitions for azure.resource_group.name and cloud.account.id consistent with existing incubating-attribute handling in this repo.
azure-resources/src/test/java/io/opentelemetry/contrib/azure/resource/AzureAppServiceResourceProviderTest.java Adds assertions for the new attributes and coverage for parsing and missing owner/resource-group behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants