Skip to content

docs(dotnet): Document GenAI data collection for AI Agents - #20870

Merged
jamescrosswell merged 2 commits into
masterfrom
ai/dotnet-ai-agents-datacollection-7c6560
Nov 24, 2026
Merged

jamescrosswell merged 2 commits into
masterfrom
ai/dotnet-ai-agents-datacollection-7c6560

Conversation

@jamescrosswell

@jamescrosswell jamescrosswell commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

DESCRIBE YOUR PR

getsentry/sentry-dotnet#5931 makes Sentry.Extensions.AI honour DataCollection.GenAI.Inputs / Outputs, and an explicit RecordInputs / RecordOutputs on AddSentry() overrides them for that chat client. The AI Agents page sets both flags to true, so an app that copied the snippet would keep sending prompts and responses after turning GenAI off.

  • Remove RecordInputs / RecordOutputs from the main and ASP.NET Core snippets.
  • Describe what each flag covers and how it combines with ConfigureDataCollection.
  • Add a section showing how to turn AI content off for every chat client.

Closes getsentry/sentry-dotnet#5954

IS YOUR CHANGE URGENT?

Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace YYYY-MM-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): YYYY-MM-DD
  • Other deadline: YYYY-MM-DD
  • No deadline: 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 supplied a deadline.

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

🤖 Generated with Claude Code

The snippets set RecordInputs and RecordOutputs to true. Once
Sentry.Extensions.AI honours DataCollection.GenAI, an explicit flag
overrides it for that chat client, so an app that copied the snippet
would keep sending prompts and responses after turning GenAI off.

Drop the flags from both snippets, describe how they combine with
DataCollection, and show how to turn AI content off for every chat
client with ConfigureDataCollection.

Closes getsentry/sentry-dotnet#5954

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Nov 22, 2026 8:59pm UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Nov 22, 2026 8:59pm UTC

Request Review

@codeowner-assignment
codeowner-assignment Bot requested a review from a team November 18, 2026 00:10
@github-actions github-actions Bot added the Priority: Normal Docs review has no urgent deadline label Nov 18, 2026
@jamescrosswell
jamescrosswell marked this pull request as ready for review November 19, 2026 21:48
@codeowner-assignment
codeowner-assignment Bot requested a review from a team November 19, 2026 21:49
@cursor

cursor Bot commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

Getting ready to monitor this change · Rollout details

Status Service Environment
⏳ Getting ready to monitor this change

@ric-oliv

Copy link
Copy Markdown
Member

Two small things in the ASP.NET Core snippet. They were there before this PR, but the snippet doesn't compile as written.

builder.Services.AddSingleton<IChatClient>(chatClient)

This line is missing its semicolon:

builder.Services.AddSingleton<IChatClient>(chatClient);

ChatResponse has no Message property in current Microsoft.Extensions.AI, so this line needs response.Text:

    return Results.Ok(response.Text);

- Warn that calling ConfigureDataCollection replaces SendDefaultPii, so an
  app on the default starts sending data such as IP addresses and failed
  request headers. Point to the per-client flags as the alternative.
- Say the GenAI options only take effect from 7.1.0. Earlier versions
  accept them but Sentry.Extensions.AI ignores them.
- Note that tool call arguments and results reach spans through both
  flags, so turning off only one doesn't keep them out.
- Fix the ASP.NET Core snippet: a missing semicolon, and
  ChatResponse has Text, not Message.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@jamescrosswell

Copy link
Copy Markdown
Collaborator Author

Fixed both in 8d183cca86: the semicolon, and response.Text.

@ric-oliv ric-oliv left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good!

@ric-oliv

Copy link
Copy Markdown
Member

@jamescrosswell now that the page says "Starting with version 7.1.0", I think we can drop the "merge only with the release" note from the description and merge as soon as the docs team approves. What do you think?

@jamescrosswell
jamescrosswell merged commit 09a273b into master Nov 24, 2026
34 of 35 checks passed
@jamescrosswell
jamescrosswell deleted the ai/dotnet-ai-agents-datacollection-7c6560 branch November 24, 2026 04:15

This branch was successfully deployed

1 active deployment
Preview – sentry-docs — 8d183cca Deployed Nov 22, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Normal Docs review has no urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the AI Agents module docs for DataCollection.GenAI

2 participants