Skip to content

Update Sentry for ZDR compliance#2529

Merged
abimaelmartell merged 2 commits intomainfrom
zdr-sentry
Dec 10, 2025
Merged

Update Sentry for ZDR compliance#2529
abimaelmartell merged 2 commits intomainfrom
zdr-sentry

Conversation

@abimaelmartell
Copy link
Copy Markdown
Member

@abimaelmartell abimaelmartell commented Dec 9, 2025

Summary by cubic

Make Sentry compliant with Zero Data Retention (ZDR). Errors from ZDR or anonymous flows are tagged and dropped before sending to Sentry, while non-ZDR errors still report normally.

  • New Features

    • Added applyZdrScope and captureExceptionWithZdrCheck helpers.
    • Drop events in Sentry beforeSend when zeroDataRetention is true (tag or extra).
    • Propagate ZDR state from controllers, scraper, and worker to Sentry scope.
  • Refactors

    • Replaced direct Sentry.captureException calls with ZDR-aware wrapper across v1/v2 search, x402 endpoints, scraper, and worker.
    • Standardized zeroDataRetention detection (using nullish coalescing) and tagging.

Written for commit cfb15f1. Summary will update automatically on new commits.

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 7 files

Prompt for AI agents (all 1 issues)

Check if these issues are valid — if so, understand the root cause of each and fix them.


<file name="apps/api/src/controllers/v2/search.ts">

<violation number="1" location="apps/api/src/controllers/v2/search.ts:763">
P0: `isZDROrAnon` is block-scoped to the `try` block and will cause a `ReferenceError` when accessed in the `catch` block. The variable needs to be declared before the `try` block or accessed differently.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

Comment thread apps/api/src/controllers/v2/search.ts
Copy link
Copy Markdown
Member

@mogery mogery left a comment

Choose a reason for hiding this comment

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

awesome

@abimaelmartell abimaelmartell merged commit 109f514 into main Dec 10, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants