Skip to content

Conversation

@philipphofmann
Copy link
Member

@philipphofmann philipphofmann commented Oct 21, 2025

DESCRIBE YOUR PR

This PR migrates the logs for crashes RFC to the BatchProcessor.

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.):
  • Other deadline:
  • 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

@vercel
Copy link

vercel bot commented Oct 21, 2025

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

Project Deployment Preview Comments Updated (UTC)
develop-docs Ready Ready Preview Comment Nov 3, 2025 4:28pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
sentry-docs Ignored Ignored Preview Nov 3, 2025 4:28pm

@codecov
Copy link

codecov bot commented Oct 29, 2025

Bundle Report

Changes will decrease total bundle size by 15 bytes (-0.0%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sentry-docs-client-array-push 10.16MB -6 bytes (-0.0%) ⬇️
sentry-docs-server-cjs 13.03MB -9 bytes (-0.0%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: sentry-docs-server-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
1729.js -3 bytes 1.78MB -0.0%
../instrumentation.js -3 bytes 1.1MB -0.0%
9523.js -3 bytes 1.08MB -0.0%
view changes for bundle: sentry-docs-client-array-push

Assets Changed:

Asset Name Size Change Total Size Change (%)
static/chunks/pages/_app-*.js -3 bytes 882.71kB -0.0%
static/chunks/8321-*.js -3 bytes 425.87kB -0.0%
server/middleware-*.js -6.46kB 1.0kB -86.59%
server/middleware-*.js 6.46kB 7.46kB 645.5% ⚠️
static/iIrk8xLk98gmbF1agnQqu/_buildManifest.js (New) 684 bytes 684 bytes 100.0% 🚀
static/iIrk8xLk98gmbF1agnQqu/_ssgManifest.js (New) 77 bytes 77 bytes 100.0% 🚀
static/x1jqul0SZumtD3sP4RvL0/_buildManifest.js (Deleted) -684 bytes 0 bytes -100.0% 🗑️
static/x1jqul0SZumtD3sP4RvL0/_ssgManifest.js (Deleted) -77 bytes 0 bytes -100.0% 🗑️

philipphofmann and others added 8 commits October 30, 2025 09:07
<!-- Use this checklist to make sure your PR is ready for merge. You may
delete any sections you don't need. -->

## DESCRIBE YOUR PR
- Add a new option `screenshotStrategy` which has been introduced in
this [PR](getsentry/sentry-java#4777) and allows
customers to specify a more reliable masking strategy.

## 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 -->
- [x] Other deadline: Ideally next week
- [ ] None: Not urgent, can wait up to 1 week+
…#15336)

<!-- 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 changed the default behavior of the integration in the latest Python
SDK release.

## 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 -->
- [x] Other deadline: ASAP as we just released this
- [ ] 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/)
This PR adds a new product page for drains, and adds a page for vercel
log drains as well. Vercel drains are marked as closed alpha for now,
but will be promoted to EA this week.
@philipphofmann philipphofmann removed request for a team October 30, 2025 08:40
@philipphofmann
Copy link
Member Author

Sorry about all the review triggers. Something got messed up when merging master into this branch.

@philipphofmann philipphofmann marked this pull request as ready for review October 30, 2025 08:42
Copy link
Member

@romtsn romtsn left a comment

Choose a reason for hiding this comment

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

lgtm, nice job!

Copy link
Member

@philprime philprime left a comment

Choose a reason for hiding this comment

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

LGTM, nice work


The BatchProcessor uses two buffers to minimize data loss in the event of an abnormal process termination:
* **Crash-Safe List**: A list stored in a crash-safe space to prevent data loss during detectable abnormal process terminations.
* **Async IO Cache**: When a process terminates without the SDK being able to detect it, the crash-safe list loses all its elements. Therefore, the BatchProcessor uses a second buffer, the async IO cache, that stores elements to disk on a background thread to avoid blocking the calling thread, which ensures minimal data loss when such terminations occur.
Copy link
Member

Choose a reason for hiding this comment

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

It's not very clear to me.
If the list is called "crash-safe list", i assume it doesn't lose elements on crash.
Is the crash-safe list kept in memory, while the async IO cache is written to file?

Copy link
Member

@cleptric cleptric left a comment

Choose a reason for hiding this comment

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

This is not a good place to document these changes. For one, this page is clearly marked as WIP, and applies to spans only.
Secondly, we have this exact work currently underway by @giortzisg, so I would kindly ask that both of these work streams are merged.
Additonally, this seems to be mostly about mobile, which is fine to be handled differently, but should be also documented accordingly.

2. Deduplicate the items based on the IDs of the items and store the deduplicated items in the `envelope-x` file.
3. Create new `async-io-cache-1` and `async-io-cache-2` files, and delete the `detected-termination-x` file.
4. Now the BatchProcessor can start receiving new items.
5. Move the `envelope-x` to the envelopes cache folder.
Copy link

Choose a reason for hiding this comment

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

Bug: Prevent Data Loss: Fix Initialization Envelope Handling

The SDK Initialization procedure is incomplete and will cause data loss. It only checks for cache files and detected-termination-x, but doesn't check for existing envelope-x files. According to the Flushing section (lines 152-155), envelope-x files are created in the batch-processor folder and then moved to the envelopes cache folder. If a crash occurs after creating envelope-x but before moving it (step 4 of flushing), the envelope-x file will be orphaned on restart. The initialization logic should first check for and move any existing envelope-x files before creating new ones, otherwise those envelopes and their data will be permanently lost.

Fix in Cursor Fix in Web

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.