-
-
Notifications
You must be signed in to change notification settings - Fork 227
feat(AI): Microsoft.Extensions.AI Agent Monitoring
#4657
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
feat(AI): Microsoft.Extensions.AI Agent Monitoring
#4657
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #4657 +/- ##
==========================================
+ Coverage 73.66% 73.82% +0.15%
==========================================
Files 476 485 +9
Lines 17442 17693 +251
Branches 3453 3499 +46
==========================================
+ Hits 12849 13061 +212
- Misses 3744 3773 +29
- Partials 849 859 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@sentry review |
|
@sentry review |
|
@BugBot review |
|
@BugBot review |
|
@sentry review |
|
@BugBot review |
|
@sentry review |
|
@BugBot review |
|
@sentry review |
|
@BugBot review |
…xtensions.AI` (#15431) <!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR We are making a new AI Agent Monitoring SDK for .NET. - getsentry/sentry-dotnet#4657 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. - [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE --> - [ ] Other deadline: <!-- ENTER DATE HERE --> - [ ] None: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've added an urgent due date to it. Thanks in advance for your help! ## PRE-MERGE CHECKLIST *Make sure you've checked the following before merging your changes:* - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) ## LEGAL BOILERPLATE <!-- Sentry employees and contractors can delete or ignore this section. --> Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms. ## EXTRA RESOURCES - [Sentry Docs contributor guide](https://docs.sentry.io/contributing/) --------- Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com>
Resolves #3762
Purpose
This PR will add a new integration for
Sentry.Extensions.AI.It will allow users to instrument their LLM usage, including any tool calls and LLM API calls.
Microsoft.Extensions.AI.AbstractionsNuGet package is used in this SDK to use their interfaces and types.Usage
In order to use this SDK, the user will have to have a compatible SDK which can instantiate an
IChatClient. In the samples, I have usedMicrosoft.Extensions.AI.OpenAI. Another popular LLM SDK isAnthropic.SDK.There are a few AI-exclusive options the users can change.
IncludeAIRequestMessages- booleantruetrue, we include the request message in the spans we send to Sentry.IncludeAIResponseContent- booleantruetrue, we include the response message in the spans we send to Sentry.AgentName- stringAgentChatClientrepresents.Once the user has set up and sends AI spans to Sentry, they will be able to see it in
Insights > AI(from the sidebar).Screen.Recording.2025-10-31.at.5.39.14.PM.mov
There are useful information about LLM usage in the webpage. Such as how many tokens the user has sent/received, what tool calls were made, how long they tool, etc.