Repository navigation
feat: DataCollection.UserInfo now gates the ASP.NET Core user in the OpenTelemetry integration - #5959
Closed
jamescrosswell wants to merge 2 commits into
Closed
jamescrosswell wants to merge 2 commits into
jamescrosswell wants to merge 2 commits into
Conversation
AspNetCoreEnricher reads DataCollectionResolver.UserInfo instead of SendDefaultPii before setting the user from ISentryUserFactory. Without ConfigureDataCollection, UserInfo bridges to SendDefaultPii, so nothing changes for apps that don't opt in. Adds an NLog integration test showing that User layouts, which the app configures explicitly, are still sent with UserInfo = false. Part of #5420 Closes #5435 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5959 +/- ##
=======================================
Coverage 77.70% 77.71%
=======================================
Files 535 535
Lines 19731 19731
Branches 3934 3934
=======================================
+ Hits 15332 15333 +1
Misses 3544 3544
+ Partials 855 854 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Without options the enricher must not collect the user. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Closing: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The OpenTelemetry integration now decides whether to put the ASP.NET Core user on the scope from the
UserInfodata collection setting instead ofSendDefaultPii.AspNetCoreEnricherreadsDataCollectionResolver.UserInfobefore it callsISentryUserFactory.Part of #5420 (Phase 2).
Closes #5435
Note
Sentry.OpenTelemetry is now deprecated anyway (we advise people to use Sentry.OpenTelemetry.Exporter instead)... It will likely be removed from the Sentry SDK for .NET in the same release that the Data Collection options become the default. So we probably don't need to invest too heavily in this area.
Behaviour
DataCollectionnot configured: unchanged.UserInfobridges toSendDefaultPii.ConfigureDataCollection(...)called:UserInfodecides, andSendDefaultPiiis ignored. This only affects apps that opted in to the experimental option.Notes for review
git grep -i piifinds nothing inSentry.Serilog,Sentry.NLog,Sentry.Log4NetorSentry.Extensions.Logging. ThesendDefaultPiisink parameter the issue mentions went away in feat(serilog)!: the Sentry sink no longer initializes the SDK #5573, when the Serilog sink stopped initializing the SDK.Userlayouts stay ungated. The app configures them, so the spec treats them as user-set data. A new integration test runs the real pipeline withUserInfo = falseand checks that the event still has the layout's id, username, email and IP address.db.statement/db.query.textstay ungated, as the issue says.SentrySpanProcessoris unchanged.DataCollection.SentrySpanProcessorcopies everyActivitytag into span data or theotelcontext:url.full,http.url,http.target,url.query) already go throughQueryStringFilterwith the default deny list (fix: filter sensitive URL query parameters before they reach Sentry #5891), but a configuredUrlQueryParams(Off, extra terms,AllowList) is ignored. PassingDataCollectionResolver.UrlQueryParamsthrough would fix that without changing anything for apps that don't opt in. It needs theQueryStringFilteroverloads that take a behaviour, which fix: always filter credentials from URLs, and apply DataCollection to failed HTTP request events #5935 adds, so it's a follow-up once fix: always filter credentials from URLs, and apply DataCollection to failed HTTP request events #5935 lands.user.*/enduser.*attributes. Those only show up when the app adds them itself, which makes them user-set data.network.peer.address, which is a client IP. It passes through ungated today. The spec scopesuserInfotouser.*fields, so this PR doesn't gate it.🤖 Generated with Claude Code