[AzureMonitorExporter] Fix Container Apps role instance showing VM GUID instead of replica name#54586
Merged
rajkumar-rangaraj merged 3 commits intoAzure:mainfrom Dec 17, 2025
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where Azure Container Apps instances were incorrectly showing VM instance GUIDs instead of replica names in the Application Insights Role Instance field. The fix reorders resource detectors to ensure the Container Apps detector runs after the VM detector, allowing it to override the service.instance.id attribute with the correct replica name.
- Reordered
AzureVMResourceDetectorandAzureContainerAppsResourceDetectorin the resource detection chain - Updated CHANGELOG to document the bug fix
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/src/OpenTelemetryBuilderExtensions.cs | Swapped the order of VM and Container Apps resource detectors so Container Apps detector runs last and can override VM attributes |
| sdk/monitor/Azure.Monitor.OpenTelemetry.AspNetCore/CHANGELOG.md | Added changelog entry documenting the fix for Container Apps role instance display issue |
harsimar
approved these changes
Dec 17, 2025
This was referenced May 1, 2026
Open
Bump Azure.Extensions.AspNetCore.Configuration.Secrets from 1.3.1 to 1.5.1
khoinguyennn/eShopOnWeb#5
Open
intellitect-bot
pushed a commit
to IntelliTect/EssentialCSharp.Web
that referenced
this pull request
May 4, 2026
Updated [Azure.Monitor.OpenTelemetry.AspNetCore](https://github.com/Azure/azure-sdk-for-net) from 1.4.0 to 1.5.0. <details> <summary>Release notes</summary> _Sourced from [Azure.Monitor.OpenTelemetry.AspNetCore's releases](https://github.com/Azure/azure-sdk-for-net/releases)._ ## 1.5.0 ## 1.5.0 (2026-04-30) ### Features Added * Add ability to specify EnableStandardMetrics and EnablePerformanceCounters ([#56438](Azure/azure-sdk-for-net#56438)) ### Breaking Changes * **Default Sampler Changed**: The default sampling behavior has been changed from `ApplicationInsightsSampler` with 100% sampling (all traces sampled) to `RateLimitedSampler` with 5.0 traces per second. This change significantly reduces telemetry volume for high-traffic applications and provides better cost optimization out of the box. **Impact**: Applications with more than 5 requests per second will see fewer traces exported by default. **Migration**: To maintain the previous behavior (100% sampling), explicitly configure the sampler: ```csharp // Option 1: Set SamplingRatio and clear TracesPerSecond builder.Services.AddOpenTelemetry() .UseAzureMonitor(options => { options.SamplingRatio = 1.0f; options.TracesPerSecond = null; }); // Option 2: Use environment variables // OTEL_TRACES_SAMPLER=microsoft.fixed_percentage // OTEL_TRACES_SAMPLER_ARG=1.0 ``` ### Bugs Fixed * Fixed an issue where Azure Container Apps instances were showing VM instance GUIDs instead of replica names in the Role Instance field. ([#54586](Azure/azure-sdk-for-net#54586)) ## 1.5.0-beta.1 ## 1.5.0-beta.1 (2026-04-28) ### Features Added - Upgraded api-version tag from `package-2024-05-01` to `package-preview-2025-06`. Tag detail available at https://github.com/Azure/azure-rest-api-specs/blob/main/specification/appconfiguration/resource-manager/readme.md. - Added `AzureFrontDoor` property to `AppConfigurationStoreData` and `AppConfigurationStorePatch` to support Azure Front Door configuration for a configuration store. - Added new model `AppConfigurationAzureFrontDoorProperties` with a `ResourceId` property representing an Azure Front Door profile resource ID. ## 1.4.2 ## 1.4.2 (2026-04-28) ### Other Changes - Upgraded dependent `Azure.Core` to 1.54.0. - Upgraded dependent `Azure.ResourceManager` to 1.14.0. ## 1.4.1 ## 1.4.1 (2026-04-27) ### Other Changes - Upgraded dependent `Azure.Core` to 1.54.0. - Upgraded dependent `Azure.ResourceManager` to 1.14.0. Commits viewable in [compare view](https://github.com/Azure/azure-sdk-for-net/commits/Azure.Monitor.OpenTelemetry.AspNetCore_1.5.0). </details> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced May 4, 2026
Open
Closed
Closed
Closed
Open
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.
Fixes #47424
Description
Fixes an issue where Azure Container Apps instances were showing VM instance GUIDs instead of replica names in the Role Instance field in Application Insights.
Root Cause
Azure Container Apps infrastructure runs on Azure VMs. When resource detection occurs, both the
AzureVMResourceDetectorandAzureContainerAppsResourceDetectordetect their respective environments and set theservice.instance.idattribute.The issue occurred because the resource detectors were ordered such that the VM detector could overwrite the Container Apps replica name with a VM instance GUID.
Solution
Reordered the resource detectors to ensure
AzureContainerAppsResourceDetectorruns afterAzureVMResourceDetector.Testing
Tested in Azure Container Apps environment to verify replica names now appear correctly in Application Insights Role Instance field.