Vendor OpenTelemetry.Resources.Azure resource detectors#3093
Merged
rajkumar-rangaraj merged 3 commits intomainfrom Jan 28, 2026
Merged
Vendor OpenTelemetry.Resources.Azure resource detectors#3093rajkumar-rangaraj merged 3 commits intomainfrom
rajkumar-rangaraj merged 3 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR vendors the OpenTelemetry.Resources.Azure library (version 1.15.0-beta.1) into the NETCORE shared folder to enable Azure resource detection capabilities for Azure App Service, Azure VMs, and Azure Container Apps environments.
Changes:
- Vendored 10 files from OpenTelemetry.Resources.Azure package with modified namespaces to avoid conflicts
- Added all vendored files to Shared.projitems for inclusion in AspNetCore and WorkerService projects
- Updated ThirdPartyNotices.txt to include OpenTelemetry .NET Contrib license
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 11 comments.
Show a summary per file
| File | Description |
|---|---|
| AppServiceResourceDetector.cs | Detects and reports Azure App Service resource attributes from environment variables |
| AzureContainerAppsResourceDetector.cs | Detects Azure Container Apps and Jobs resource attributes |
| AzureResourceBuilderExtensions.cs | Extension methods to register Azure resource detectors with OpenTelemetry ResourceBuilder |
| AzureVMResourceDetector.cs | Detects Azure VM resource attributes via Azure Instance Metadata Service |
| AzureVmMetaDataRequestor.cs | HTTP client wrapper for querying Azure VM metadata endpoint |
| AzureVmMetadataResponse.cs | Data model for Azure VM metadata API response |
| Guard.cs | Input validation utility with polyfills for older target frameworks |
| ResourceAttributeConstants.cs | Constants for Azure-specific resource attribute keys and environment variable names |
| ResourceSemanticConventions.cs | OpenTelemetry semantic convention constants for resource attributes |
| SourceGenerationContext.cs | System.Text.Json source generation context for .NET 6+ performance optimization |
| Shared.projitems | Project configuration to include all vendored files in compilation |
| ThirdPartyNotices.txt | Added OpenTelemetry .NET Contrib license attribution |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVMResourceDetector.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureResourceBuilderExtensions.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVmMetaDataRequestor.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVmMetaDataRequestor.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVMResourceDetector.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVmMetaDataRequestor.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVmMetaDataRequestor.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVMResourceDetector.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVMResourceDetector.cs
Show resolved
Hide resolved
NETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/AzureVMResourceDetector.cs
Show resolved
Hide resolved
harsimar
approved these changes
Jan 28, 2026
This was referenced Feb 1, 2026
Open
Open
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.
Description
This PR vendors the OpenTelemetry.Resources.Azure library (version 1.15.0-beta.1) into the NETCORE shared folder to enable Azure resource detection capabilities.
Steps Followed to Vendor Code
Created a New Branch in ApplicationInsights-dotnet repo for these changes.
Synced OpenTelemetry.NET Contrib Repository
Vendored
OpenTelemetry.Resources.AzureNETCORE/src/Shared/Vendoring/OpenTelemetry.Resources.Azure/:AppServiceResourceDetector.csAzureContainerAppsResourceDetector.csAzureResourceBuilderExtensions.csAzureVmMetaDataRequestor.csAzureVmMetadataResponse.csAzureVMResourceDetector.csResourceAttributeConstants.csSourceGenerationContext.cs*.csproj,README.md,CHANGELOG.md,AssemblyInfo.csVendored Shared Dependencies
ResourceSemanticConventions.csfrom OpenTelemetry.NET Contrib Shared folderGuard.csand related utility classes from OpenTelemetry dependenciesUpdated Project Configuration
NETCORE/src/Shared/Shared.projitemsfor inclusion in AspNetCore and WorkerService projectsCode Modifications
OpenTelemetry.Resources.Azure→Microsoft.ApplicationInsights.Shared.Vendoring.OpenTelemetry.Resources.AzureOpenTelemetry.Resources→Microsoft.ApplicationInsights.Shared.Vendoring.OpenTelemetry.ResourcesOpenTelemetry.Trace→Microsoft.ApplicationInsights.Shared.Vendoring.OpenTelemetry.Traceinternalvisibility to prevent namespace conflictsCHANGELOG.mdto document the vendored codeTesting