-
Notifications
You must be signed in to change notification settings - Fork 192
feat: add user/app context in controlplane sentry #2335
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
Open
miklosbarabas
wants to merge
12
commits into
main
Choose a base branch
from
miklos/eng-8489-add-user-context-in-controlplane-sentry-for-customer
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−4
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
30c821a
feat: add user context in controlplane sentry
miklosbarabas 2bc1941
feat: add user context in controlplane sentry
miklosbarabas bd1e37f
feat: add user context in controlplane sentry
miklosbarabas 036ee65
feat: add user context in controlplane sentry
miklosbarabas 18ce188
feat: add user context in controlplane sentry
miklosbarabas 47c630a
feat: add user context in controlplane sentry
miklosbarabas db7c87c
feat: add user context in controlplane sentry
miklosbarabas e6d811f
feat: add user context in controlplane sentry
miklosbarabas 5287c98
feat: add user context in controlplane sentry
miklosbarabas 1382a46
feat: add user context in controlplane sentry
miklosbarabas 70e97ba
feat: add user context in controlplane sentry
miklosbarabas ec97d98
feat: add user context in controlplane sentry
miklosbarabas File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
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.
🧩 Analysis chain
Post-auth Sentry context enrichment looks correct; confirm PII/data-handling expectations
The Sentry enrichment hook is defensively implemented:
opts.sentry.enabled && opts.sentry.dsn.authContext(userId, userDisplayName, organizationId, organizationSlug, apiKeyName, auth) match theAuthContextshape and are guarded where optional.Functionally this achieves the goal of enriching Sentry with user/org/auth context. The main consideration is that you’re now sending user identifiers (userId, userDisplayName) and org-identifying data (organizationId, organizationSlug, apiKeyName) to Sentry on every authenticated request. Please double-check that this aligns with your privacy/PII and data-retention policies for production Sentry projects (e.g., whether user display names are acceptable, or if they should be pseudonymized).
🏁 Script executed:
Length of output: 2624
🏁 Script executed:
Length of output: 1116
🏁 Script executed:
Length of output: 438
🏁 Script executed:
Length of output: 371
🏁 Script executed:
Length of output: 2269
🏁 Script executed:
Length of output: 1105
🏁 Script executed:
Length of output: 155
🏁 Script executed:
Length of output: 483
🏁 Script executed:
Length of output: 3259
🏁 Script executed:
Length of output: 3447
🏁 Script executed:
Length of output: 155
🏁 Script executed:
Length of output: 373
🏁 Script executed:
Length of output: 101
Enrichment hook bypasses Sentry's sendDefaultPii security setting; PII is sent unconditionally
The code is defensively implemented (try-catch, gated on
opts.sentry.enabled && opts.sentry.dsn), and field guards are correct for optional fields. However, verification reveals a PII handling inconsistency:sendDefaultPii: SENTRY_SEND_DEFAULT_PII, which defaults tofalse{ enabled: boolean; dsn?: string }— thesendDefaultPiiflag is not accessible to the enrichment callbacksendDefaultPiisettingThe enrichment hook should either:
sendDefaultPiiflag before calling Sentry.setUser/setTag, or🤖 Prompt for AI Agents