-
Notifications
You must be signed in to change notification settings - Fork 271
Disable telemetry for HTTP transport #1072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
core/Azure.Mcp.Core/src/Configuration/AzureMcpServerConfiguration.cs
Outdated
Show resolved
Hide resolved
core/Azure.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs
Outdated
Show resolved
Hide resolved
core/Azure.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works, but I think you could have just done an #ifdef HTTP and set options.IsTelemetryEnabled = false;
core/Azure.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs
Outdated
Show resolved
Hide resolved
@anuchandy PTAL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR disables telemetry collection when the Azure MCP server is running in HTTP transport mode. The change ensures telemetry is only collected for stdio transport connections.
- Updated the telemetry configuration logic to check the transport type and disable telemetry for HTTP transport
- Modified the debug launch settings to use the new
--transport httpflag instead of the deprecated--run-as-remote-http-serviceflag - Updated the CHANGELOG to document the telemetry behavior change
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs | Added logic to disable telemetry when transport is HTTP; removed unused imports |
| servers/Azure.Mcp.Server/src/Properties/launchSettings.json | Updated debug profile to use --transport http flag |
| servers/Azure.Mcp.Server/CHANGELOG.md | Added changelog entry for telemetry behavior change |
| core/Azure.Mcp.Core/src/Areas/Server/Commands/ServiceStartCommand.cs | Removed unused import |
What does this PR do?
This pull request introduces an important change to how telemetry is enabled for the Azure MCP Server. Telemetry collection is now automatically disabled when the server is running with HTTP transport, ensuring that telemetry is only collected for the default (stdio) transport. This change is reflected in both the configuration logic and the documentation. Additionally, there are minor code cleanups and updates to launch settings.
Telemetry configuration changes:
OpenTelemetryExtensions.ConfigureOpenTelemetryto check theServiceStartOptions.Transportproperty and only enable telemetry for stdio transport.Configuration and code cleanup:
launchSettings.jsonto use the new--transport httpflag for clarity and consistency.ServiceStartCommand.csandOpenTelemetryExtensions.csfor cleaner code. [1] [2]These changes help ensure telemetry is only collected when appropriate and improve the maintainability of the codebase.
GitHub issue number?
[Link to the GitHub issue this PR addresses]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 prompts/servers/Azure.Mcp.Server/docs/e2eTestPrompts.mdcrypto mining, spam, data exfiltration, etc.)/azp run mcp - pullrequest - liveto run Live Test Pipeline