-
Notifications
You must be signed in to change notification settings - Fork 231
Users/saars/add app insights list app traces #672
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
base: main
Are you sure you want to change the base?
Users/saars/add app insights list app traces #672
Conversation
...ights/tests/Azure.Mcp.Tools.ApplicationInsights.LiveTests/ApplicationInsightsCommandTests.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.
Pull Request Overview
This PR adds a tool to ApplicationInsights for querying trace data by running KQL queries. It introduces the first piece of functionality to query user's Application Insights trace data using the azmcp_applicationinsights_apptrace_list
command.
- Added new
AppTraceListCommand
for listing distributed trace metadata from Application Insights components - Implemented KQL query building service for constructing Application Insights queries
- Added service layer for executing Azure Monitor Log queries against Application Insights resources
Reviewed Changes
Copilot reviewed 32 out of 32 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/AppTrace/AppTraceListCommand.cs | New command implementation for listing Application Insights traces |
tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/KQLQueryBuilder.cs | KQL query builder service for constructing Application Insights queries |
tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/ApplicationInsightsService.cs | Updated service to support distributed trace listing functionality |
tools/Azure.Mcp.Tools.ApplicationInsights/src/ApplicationInsightsSetup.cs | Registered new services and commands in DI container |
core/Azure.Mcp.Core/src/Services/Azure/Resource/ResourceResolverService.cs | Moved ResourceResolverService to core namespace for reuse |
servers/Azure.Mcp.Server/README.md | Updated documentation with new Application Insights trace commands |
docs/azmcp-commands.md | Added documentation for new apptrace list command |
Comments suppressed due to low confidence (1)
tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/AppTrace/AppTraceListCommand.cs:1
- The description section contains inconsistent formatting with escaped quotes and mixed single/double quotes that could confuse users reading the help text.
// Copyright (c) Microsoft Corporation.
...tionInsights/tests/Azure.Mcp.Tools.ApplicationInsights.UnitTests/AppTraceListCommandTests.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/KQLQueryBuilder.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/AppLogsQueryClient.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/AppTrace/AppTraceListCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/AppTrace/AppTraceListCommand.cs
Outdated
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Models/Query/ListTraceQueryResponse.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Options/ApplicationInsightsOptionDefinitions.cs
Outdated
Show resolved
Hide resolved
aa242cf
to
65371ee
Compare
core/Azure.Mcp.Core/src/Services/Azure/Resource/IResourceResolverService.cs
Show resolved
Hide resolved
tools/Azure.Mcp.Tools.ApplicationInsights/src/Commands/AppTrace/AppTraceListCommand.cs
Outdated
Show resolved
Hide resolved
65371ee
to
b99da41
Compare
core/Azure.Mcp.Core/src/Services/Azure/Resource/IResourceResolverService.cs
Show resolved
Hide resolved
4a241f8
to
07a7760
Compare
tools/Azure.Mcp.Tools.ApplicationInsights/src/Services/AppLogsQueryClient.cs
Outdated
Show resolved
Hide resolved
4948323
to
74ddf1d
Compare
@srnagar it looks like this missed the October release window. Please help ensure this gets merged for the November release on day-1 |
| join kind=leftouter ({{remainingQueries[2]}}) on operation_Id | ||
| summarize sum(itemCount), arg_min(ai_hash(operation_Id), operation_Id, column_ifexists("id", '')) by itemType, operation_Name, resultCode, problemId, target, type, resultCode1, name, location | ||
| summarize traces=make_list(bag_pack('traceId', operation_Id, 'spanId', column_ifexists("id", '')), 3), sum(sum_itemCount) by itemType, {{keyDimensions}} | ||
| top 10 by sum_sum_itemCount desc |
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.
Should we update documentation to mention that this returns the top 10 results? Do we plan to make this a customizable option on how many results we return?
What does this PR do?
Add a tool to ApplicationInsights for query the trace.
This is the first piece, and simple query tool to query user's application insights trace data by running KQL queries.
GitHub issue number?
#671
Pre-merge Checklist
servers/Azure.Mcp.Server/CHANGELOG.md
and/orservers/Fabric.Mcp.Server/CHANGELOG.md
for product changes (features, bug fixes, UI/UX, updated dependencies
)servers/Azure.Mcp.Server/README.md
and/orservers/Fabric.Mcp.Server/README.md
documentation/docs/azmcp-commands.md
and/or/docs/fabric-commands.md
ToolDescriptionEvaluator
and obtained a score of0.4
or more and a top 3 ranking for all related test prompts/docs/e2eTestPrompts.md
crypto mining, spam, data exfiltration, etc.
)/azp run mcp - pullrequest - live
to run Live Test Pipeline