Skip to content

Use entry Assembly for telemetry version, always learn when learn=true#1122

Merged
alzimmermsft merged 5 commits intomicrosoft:mainfrom
alzimmermsft:SmallTelemetryFixes
Nov 10, 2025
Merged

Use entry Assembly for telemetry version, always learn when learn=true#1122
alzimmermsft merged 5 commits intomicrosoft:mainfrom
alzimmermsft:SmallTelemetryFixes

Conversation

@alzimmermsft
Copy link
Copy Markdown
Contributor

What does this PR do?

Two small fixes:

  1. Incorrect Assembly was being used to set Version in telemetry. This has been corrected to the entry Assembly, which will now produce the correct Version for telemetry.
  2. --mode namespace still had a path where learn=true wouldn't result in learning happening.

GitHub issue number?

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 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
Copy Markdown
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 addresses two bugs in the Azure MCP Core:

  • Corrects telemetry version reporting by using the entry assembly instead of the calling assembly
  • Fixes namespace mode learning to respect the learn=true flag regardless of whether a command is specified

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs Changed GetServerVersion to SetServerVersion, switched from GetCallingAssembly() to GetEntryAssembly() for accurate version telemetry, and added null safety check
core/Azure.Mcp.Core/src/Areas/Server/Commands/ToolLoading/NamespaceToolLoader.cs Removed condition that prevented learning when a command was specified, ensuring learn=true always triggers learning mode

Comment thread core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs Outdated
Comment thread core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
Comment thread core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
Comment thread core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs Outdated
@github-project-automation github-project-automation Bot moved this from Untriaged to In Progress in Azure MCP Server Nov 10, 2025
Comment thread core/Azure.Mcp.Core/src/Extensions/OpenTelemetryExtensions.cs
@alzimmermsft alzimmermsft enabled auto-merge (squash) November 10, 2025 20:36
@alzimmermsft alzimmermsft merged commit 9a6bea8 into microsoft:main Nov 10, 2025
26 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Azure MCP Server Nov 10, 2025
@alzimmermsft alzimmermsft deleted the SmallTelemetryFixes branch November 10, 2025 22:06
colbytimm pushed a commit to colbytimm/microsoft-mcp that referenced this pull request Dec 8, 2025
microsoft#1122)

* Use entry Assembly for telemetry version, always learn when learn=true

* Add CHANGELOG entry

* PR feedback

* One small fix

* Fix code-docs mismatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants