Support log telemetry for user's AppInsight instance#1638
Merged
srnagar merged 11 commits intomicrosoft:mainfrom Feb 5, 2026
Merged
Support log telemetry for user's AppInsight instance#1638srnagar merged 11 commits intomicrosoft:mainfrom
srnagar merged 11 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors OpenTelemetry configuration to separate the setup logic for Microsoft-owned and user-provided Application Insights instances. The changes introduce clearer method naming through specialized configuration methods and add a new constants class to distinguish between telemetry destinations.
Changes:
- Splits generic Azure Monitor exporter configuration into two specialized methods: one for Microsoft telemetry and one for user-provided telemetry
- Introduces
AppInsightsInstanceTypeconstants class to standardize naming for telemetry destinations - Removes OpenTelemetry logger setup from
ConfigureOpenTelemetryLogger, with logging now only configured for user-provided Application Insights
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/Microsoft.Mcp.Core/src/Commands/TelemetryConstants.cs | Adds new AppInsightsInstanceType class with constants for Microsoft and UserProvided telemetry destinations |
| core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs | Refactors Azure Monitor configuration into two specialized methods, removes logger setup from ConfigureOpenTelemetryLogger, and updates exporter naming to use new constants |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
alzimmermsft
approved these changes
Feb 3, 2026
anuchandy
approved these changes
Feb 3, 2026
anuchandy
approved these changes
Feb 4, 2026
AmosHersch
approved these changes
Feb 5, 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.
What does this PR do?
This pull request refactors how OpenTelemetry is configured for Azure Monitor exporters, separating the logic for Microsoft-owned and user-provided Application Insights instances. It introduces clearer method naming and a new constants class to distinguish between telemetry destinations, and moves logger configuration to be handled exclusively in Azure Monitor setup.
Telemetry configuration refactoring:
ConfigureAzureMonitorExportermethod into two specialized methods:ConfigureMicrosoftAzureMonitorExporterandConfigureUserProvidedAzureMonitorExporter, making the configuration for Microsoft and user-provided telemetry more explicit (OpenTelemetryExtensions.cs).EnableAzureMonitorto call the new specialized configuration methods based on the telemetry destination (OpenTelemetryExtensions.cs) [1] [2].Constants and naming improvements:
AppInsightsInstanceTypeclass to define constants for distinguishing between Microsoft and user-provided Application Insights instances (TelemetryConstants.cs).AppInsightsInstanceTypeconstants for naming exporters instead of passing string literals (OpenTelemetryExtensions.cs) [1] [2].Logger configuration changes:
ConfigureOpenTelemetryLoggerand moved logger configuration to be handled within Azure Monitor setup, preventing duplicate configuration (OpenTelemetryExtensions.cs).GitHub issue number?
https://github.com/microsoft/mcp-pr/issues/185
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.mdand/orservers/Fabric.Mcp.Server/CHANGELOG.mdfor product changes (features, bug fixes, UI/UX, updated dependencies)servers/Azure.Mcp.Server/README.mdand/orservers/Fabric.Mcp.Server/README.mddocumentationeng/scripts/Process-PackageReadMe.ps1. See Package README/servers/Azure.Mcp.Server/docs/azmcp-commands.mdand/or/docs/fabric-commands.md.\eng\scripts\Update-AzCommandsMetadata.ps1to update tool metadata in azmcp-commands.md (required for CI)ToolDescriptionEvaluatorand obtained a score of0.4or more and a top 3 ranking for all related test promptsconsolidated-tools.json/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline