Skip to content

Conversation

@alzimmermsft
Copy link
Contributor

What does this PR do?

Removes capturing ErrorDetails in telemetry.

GitHub issue number?

[Link to the GitHub issue this PR addresses]

Pre-merge Checklist

  • Required for All PRs
    • Read contribution guidelines
    • PR title clearly describes the change
    • Commit history is clean with descriptive messages (cleanup guide)
    • Added comprehensive tests for new/modified functionality
    • Updated servers/Azure.Mcp.Server/CHANGELOG.md and/or servers/Fabric.Mcp.Server/CHANGELOG.md for product changes (features, bug fixes, UI/UX, updated dependencies)
  • For MCP tool changes:
    • One tool per PR: This PR adds or modifies only one MCP tool for faster review cycles
    • Updated servers/Azure.Mcp.Server/README.md and/or servers/Fabric.Mcp.Server/README.md documentation
    • Validate README.md changes using script at eng/scripts/Process-PackageReadMe.ps1. See Package README
    • Updated command list in /servers/Azure.Mcp.Server/docs/azmcp-commands.md and/or /docs/fabric-commands.md
    • Run .\eng\scripts\Update-AzCommandsMetadata.ps1 to update tool metadata in azmcp-commands.md (required for CI)
    • For new or modified tool descriptions, ran ToolDescriptionEvaluator and obtained a score of 0.4 or more and a top 3 ranking for all related test prompts
    • For tools with new names, including new tools or renamed tools, update consolidated-tools.json
    • For new tools associated with Azure services or publicly available tools/APIs/products, add URL to documentation in the PR description
  • Extra steps for Azure MCP Server tool changes:
    • Updated test prompts in /servers/Azure.Mcp.Server/docs/e2eTestPrompts.md
    • 👉 For Community (non-Microsoft team member) PRs:
      • Security review: Reviewed code for security vulnerabilities, malicious code, or suspicious activities before running tests (crypto mining, spam, data exfiltration, etc.)
      • Manual tests run: added comment /azp run mcp - pullrequest - live to run Live Test Pipeline

Copy link
Contributor

Copilot AI left a 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 removes the capture of ErrorDetails in telemetry by commenting out calls to AddTag(TagName.ErrorDetails, ...) across the codebase. The change aims to prevent sensitive error information from being sent to telemetry endpoints.

Changes:

  • Commented out ErrorDetails tag additions in exception handling across multiple files
  • Updated documentation to reflect the removal of ErrorDetails telemetry
  • Commented out test assertions that verified ErrorDetails tags were set

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
core/Microsoft.Mcp.Core/src/Commands/BaseCommand.cs Removed ErrorDetails tag from base exception handler
core/Azure.Mcp.Core/src/Commands/CommandFactory.cs Removed ErrorDetails tags from command execution error handling
core/Azure.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs Removed ErrorDetails tags from tool execution and list tools error handlers
core/Azure.Mcp.Core/tests/Azure.Mcp.Core.UnitTests/Areas/Server/Commands/Runtime/McpRuntimeTests.cs Commented out test assertions for ErrorDetails tags
servers/Azure.Mcp.Server/docs/new-command.md Updated documentation example to reflect removal of ErrorDetails tag
Comments suppressed due to low confidence (1)

core/Azure.Mcp.Core/src/Areas/Server/Commands/Runtime/McpRuntime.cs:123

  • This line still uses TagName.ErrorDetails and should be commented out or removed to complete the removal of ErrorDetails from telemetry. This is inconsistent with the other changes in the PR.
                activity?.SetTag(TagName.ErrorDetails, textContent.Text);

if (response.Status < HttpStatusCode.OK || response.Status >= HttpStatusCode.Ambiguous)
{
activity?.SetStatus(ActivityStatusCode.Error).AddTag(TagName.ErrorDetails, response.Message);
activity?.SetStatus(ActivityStatusCode.Error);; //.AddTag(TagName.ErrorDetails, response.Message);
Copy link

Copilot AI Jan 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double semicolon syntax error. Remove the extra semicolon after SetStatus(ActivityStatusCode.Error).

Suggested change
activity?.SetStatus(ActivityStatusCode.Error);; //.AddTag(TagName.ErrorDetails, response.Message);
activity?.SetStatus(ActivityStatusCode.Error); //.AddTag(TagName.ErrorDetails, response.Message);

Copilot uses AI. Check for mistakes.
@JasonYeMSFT
Copy link
Member

The code that adds the error details are commented out instead of removed. Do you intend to bring them back some time soon?

@alzimmermsft
Copy link
Contributor Author

The code that adds the error details are commented out instead of removed. Do you intend to bring them back some time soon?

They will eventually be added back, but for now I'll delete the code as where this information is captured may change locations.

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Jan 15, 2026
@alzimmermsft alzimmermsft merged commit 5709602 into microsoft:main Jan 15, 2026
27 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Azure MCP Server Jan 15, 2026
@alzimmermsft alzimmermsft deleted the StopCapturingAllErrors branch January 15, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants