Add Azure App Service account and resource group attributes - #3074
Open
Lewis-E wants to merge 3 commits into
Open
Add Azure App Service account and resource group attributes#3074Lewis-E wants to merge 3 commits into
Lewis-E wants to merge 3 commits into
Conversation
Signed-off-by: E. Lewis <7704925+Lewis-E@users.noreply.github.com>
Signed-off-by: E. Lewis <7704925+Lewis-E@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
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.idderived fromWEBSITE_OWNER_NAME(including parsing the subscription ID before+when present). - Emit
azure.resource_group.namederived fromWEBSITE_RESOURCE_GROUP. - Refactor
resourceUriconstruction 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.
trask
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
Update the Azure App Service resource detector to emit:
cloud.account.id- fromWEBSITE_OWNER_NAME[sem-conv]azure.resource_group.name- fromWEBSITE_RESOURCE_GROUP[sem-conv]Updated
resourceUrito 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:
+inWEBSITE_OWNER_NAME.Documentation:
This aligns the existing detector with the canonical Azure App Service resource attribute map.
Outstanding items:
Did not change
cloud.platformfromazure_app_servicetoazure.app_serviceeven though that is the current convention per open-telemetry/semantic-conventions#1698