Skip to content

Monitor Instrumentation: Support more languages and frameworks#2115

Open
xiang17 wants to merge 21 commits intomicrosoft:mainfrom
xiang17:xiang17/MonitorInstrumentation_remaining
Open

Monitor Instrumentation: Support more languages and frameworks#2115
xiang17 wants to merge 21 commits intomicrosoft:mainfrom
xiang17:xiang17/MonitorInstrumentation_remaining

Conversation

@xiang17
Copy link
Member

@xiang17 xiang17 commented Mar 19, 2026

What does this PR do?

[Provide a clear, concise description of the changes]
Support more languages and frameworks for the Monitor Instrumentation tool

[Any additional context, screenshots, or information that helps reviewers]
Azure Monitor Instrumentation in the Monitor tool now supports guided onboarding for .NET, Node.js, and Python workloads, with framework-aware recommendations and code/package actions. Supported targets include ASP.NET Core, Worker Service, ASP.NET classic (including MVC/WebForms), Express, Fastify, NestJS, Next.js, LangChain.js, Node.js database/logging variants (Postgres, MongoDB, Redis, MySQL, Winston, Bunyan, console), and Python frameworks/apps (Django, Flask, FastAPI, Falcon, Starlette, GenAI, and generic console/script apps). .NET also supports brownfield migration guidance for Application Insights SDK to 3.x and enhancement flows for projects already on Application Insights 3.x or Azure Monitor Distro.

GitHub issue number?

[Link to the GitHub issue this PR addresses]
#1801

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 renamed tools, follow the Tool Rename Checklist and tag the PR with the breaking-change label
    • 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

Expands the Azure Monitor Instrumentation tool to support additional languages/frameworks (notably Node.js and Python), adds an enhancement-selection step to the orchestration flow, and broadens .NET (Application Insights 3.x) onboarding/migration guidance and generators.

Changes:

  • Added a new send_enhanced_selection command/tool and supporting options, wiring, and docs.
  • Introduced new detectors and generators for Node.js/Python and additional .NET app types (classic ASP.NET, Worker Service, enhancements).
  • Expanded learning resources/templates and updated generator configs/docs to reflect Application Insights 3.x migration/onboarding patterns.

Reviewed changes

Copilot reviewed 101 out of 101 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tools/Azure.Mcp.Tools.Monitor/tests/Azure.Mcp.Tools.Monitor.UnitTests/Instrumentation/Tools/SendBrownfieldAnalysisToolTests.cs Updates unit tests for new brownfield findings shape (added logging findings param).
tools/Azure.Mcp.Tools.Monitor/src/Tools/Instrumentation/SendEnhancedSelectionTool.cs New tool to accept enhancement selections and generate an enhancement plan.
tools/Azure.Mcp.Tools.Monitor/src/Tools/Instrumentation/SendBrownfieldAnalysisTool.cs Extends brownfield submission to include logging findings.
tools/Azure.Mcp.Tools.Monitor/src/Options/Instrumentation/MonitorInstrumentationOptionDefinitions.cs Adds enhancement-keys option; updates findings JSON description.
tools/Azure.Mcp.Tools.Monitor/src/Options/Instrumentation/CommandOptions.cs Adds options model for enhanced selection command.
tools/Azure.Mcp.Tools.Monitor/src/MonitorSetup.cs Registers new detectors/generators and the new enhanced selection tool/command.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/TelemetryPipelineTemplate.cs New analysis template section for telemetry pipeline findings.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/ServiceOptionsTemplate.cs Extends service-options template with more WorkerService/AppInsights 3.x fields.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/LoggingTemplate.cs New analysis template section for logging findings.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/Constants.cs Adds learning resources/packages/intents constants for new scenarios.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/BrownfieldFindings.cs Adds LoggingFindings to brownfield payload model.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/AnalysisTemplate.cs Adds default placeholders for telemetry pipeline + logging findings.
tools/Azure.Mcp.Tools.Monitor/src/Models/Instrumentation/Analysis.cs Adds IsTargetVersion to ExistingInstrumentation.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/migration/dotnet/workerservice-2x-to-3x-no-code-change.md New migration doc for Worker Service “no code change” path.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/migration/dotnet/workerservice-2x-to-3x-code-migration.md New Worker Service code-migration doc (2.x→3.x).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/migration/dotnet/ilogger-migration.md New logger/filter migration doc for 2.x→3.x.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/migration/dotnet/console-2x-to-3x-code-migration.md New console-app migration doc for 2.x→3.x.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/migration/dotnet/aad-authentication-migration.md New AAD auth migration doc for 2.x→3.x.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/generator-configs/templates/express/instrumentation-code.js New Express code template for Node.js distro setup.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/generator-configs/templates/aspnetcore/instrumentation-code.cs Updates ASP.NET Core snippet to App Insights (vs distro).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/generator-configs/aspnetcore-greenfield.json Updates ASP.NET Core greenfield flow to App Insights 3.x approach/package/config.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/generator-configs/aspnet-classic-greenfield.json Adjusts classic ASP.NET onboarding flow (VS NuGet PMC + manual verify step).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/python/generic-setup.md New Python generic setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/python/genai-setup.md New Python GenAI setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/python/flask-setup.md New Python Flask setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/nodejs/redis-setup.md New Node.js + Redis setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/nodejs/postgres-setup.md New Node.js + PostgreSQL setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/nodejs/nestjs-setup.md New Node.js NestJS setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/nodejs/mongodb-setup.md New Node.js + MongoDB setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/nodejs/express-setup.md New Node.js Express setup example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/dotnet/workerservice-setup.md New .NET Worker Service setup example for App Insights.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/dotnet/aspnetcore-setup.md Updates ASP.NET Core example to App Insights 3.x.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/dotnet/aspnetcore-distro-setup.md Adds a distro-focused ASP.NET Core example (kept separately).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/examples/dotnet/aspnet-classic-setup.md Adds classic ASP.NET App Insights setup guidance.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/python/opentelemetry-pipeline.md New Python OTel pipeline concept doc.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/python/azure-monitor-overview.md New Azure Monitor (Python) overview concept doc.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/nodejs/azure-monitor-overview.md New Azure Monitor (Node.js) overview concept doc.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/dotnet/opentelemetry-pipeline.md Updates .NET concept cross-links to App Insights content.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/dotnet/azure-monitor-distro.md Updates distro doc to point to distro-specific example.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/dotnet/aspnet-classic-appinsights.md New classic ASP.NET App Insights concept doc.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/concepts/dotnet/appinsights-aspnetcore.md New App Insights ASP.NET Core concept doc.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/TelemetryConfigurationBuilder.md New API reference for non-DI extensibility entry point.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/TelemetryClient.md New TelemetryClient breaking-changes doc for 3.x.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/SqlClientInstrumentation.md New SqlClient instrumentation API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/RedisInstrumentation.md New Redis instrumentation API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/OtlpExporter.md New OTLP exporter API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/LogProcessors.md Adds missing using OpenTelemetry.Logs; note for logger provider filtering.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/HttpInstrumentation.md New HTTP enrichment/filtering API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/EntityFrameworkInstrumentation.md New EF Core instrumentation API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/ConsoleExporter.md New console exporter API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/ConfigureOpenTelemetryProvider.md Adds examples/usings for ConfigureResource patterns.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/ApplicationInsightsWeb.md New classic ASP.NET Web SDK API reference.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Resources/api-reference/dotnet/AddApplicationInsightsTelemetryWorkerService.md New Worker Service API reference for App Insights 3.x.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/WorkerServiceGreenfieldGenerator.cs New greenfield generator for Worker Service onboarding.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/WorkerServiceBrownfieldGenerator.cs New brownfield generator for Worker Service migration.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/WinstonNodeJsGreenfieldGenerator.cs New Node.js Winston generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/RedisNodeJsGreenfieldGenerator.cs New Node.js Redis generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/PostgresNodeJsGreenfieldGenerator.cs New Node.js Postgres generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/NextJsGreenfieldGenerator.cs New Next.js generator (instrumentation hook + next.config.js guidance).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/NestJsGreenfieldGenerator.cs New NestJS generator (tracing.ts + first-import guidance).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/MySQLNodeJsGreenfieldGenerator.cs New Node.js MySQL generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/MongoDBNodeJsGreenfieldGenerator.cs New Node.js MongoDB generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/LangchainJsGreenfieldGenerator.cs New LangChain.js generator (ESM/CJS handling).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/FastifyGreenfieldGenerator.cs New Fastify generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/ExpressGreenfieldGenerator.cs New Express generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/DotNetEnhancementGenerator.cs New .NET enhancement generator + supported enhancement catalog.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/ConsoleNodeJsGreenfieldGenerator.cs New Node.js console generator (applicationinsights fallback).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/BunyanNodeJsGreenfieldGenerator.cs New Node.js Bunyan generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/AspNetClassicGreenfieldGenerator.cs New classic ASP.NET greenfield generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Generators/AspNetClassicBrownfieldGenerator.cs New classic ASP.NET brownfield migration generator.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/PythonLanguageDetector.cs New Python language detector.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/PythonAppTypeDetector.cs New Python app-type detector (framework/genai heuristics).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/NodeJsLanguageDetector.cs New Node.js language detector.
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/NodeJsInstrumentationDetector.cs New Node.js instrumentation detector (package.json heuristics).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/NodeJsAppTypeDetector.cs New Node.js app-type detector (dependency heuristics).
tools/Azure.Mcp.Tools.Monitor/src/Instrumentation/Detectors/DotNetInstrumentationDetector.cs Enhances .NET detector with packages.config scanning + target-version detection.
tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/SendEnhancedSelectionCommand.cs New command for enhancement selection submission.
tools/Azure.Mcp.Tools.Monitor/src/Commands/Instrumentation/SendBrownfieldAnalysisCommand.cs Passes logging findings through to tool submission.
servers/Azure.Mcp.Server/src/Resources/consolidated-tools.json Adds enhanced selection tool to the monitor instrumentation “guide” tool mapping.
servers/Azure.Mcp.Server/docs/e2eTestPrompts.md Adds E2E prompts for monitor_instrumentation_send_enhanced_selection.
servers/Azure.Mcp.Server/docs/azmcp-commands.md Documents send_enhanced_selection usage and expectations.
servers/Azure.Mcp.Server/changelog-entries/1773863632737.yaml Updates changelog entry metadata (currently invalid pr format).

@github-project-automation github-project-automation bot moved this from Untriaged to In Progress in Azure MCP Server Mar 20, 2026
- Add nuget-vs package manager case with Install-Package command and
  Package Manager Console instructions for classic ASP.NET scenarios
- Add XML config file handling in AddConfig (ApplicationInsights.config,
  Web.config) instead of always emitting JSON instructions
- Restore detailed BuildAnalysisInstruction with per-section guidance
  for brownfield analysis (AAD auth, telemetry types, Activity.Current)
- Update AnalysisTemplate placeholders with comprehensive examples
  (all Track methods, IConfigureOptions, AAD auth mentions)
- Restore BuildValidateInstallInstructions with FilesToExist and
  FileContentChecks support for validate-install actions
- Add missing middleware telemetry access and manually-constructed
  telemetry object sections to migration doc
…fixes-remaining

Sync missing logic from standalone instrumentation MCP server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

5 participants