Skip to content

Conversation

@dcramer
Copy link
Member

@dcramer dcramer commented Oct 31, 2025

After the Durable Objects to stateless migration, console logs captured were being dropped because Sentry.flush() wasn't wrapped in ctx.waitUntil(). This caused the Worker to terminate before the buffered logs could be sent to Sentry.

Traces continued to work because they're sent immediately when spans complete, but logs are buffered and require explicit flushing.

This restores the behavior from the old DO implementation where this.ctx.waitUntil(Sentry.flush()) ensured logs were sent.

After the Durable Objects to stateless migration, console logs captured by
consoleLoggingIntegration() were being dropped because Sentry.flush() wasn't
wrapped in ctx.waitUntil(). This caused the Worker to terminate before the
buffered logs could be sent to Sentry.

Traces continued to work because they're sent immediately when spans complete,
but logs are buffered and require explicit flushing.

This restores the behavior from the old DO implementation where
this.ctx.waitUntil(Sentry.flush()) ensured logs were sent.

Co-authored-by: Claude Code <noreply@anthropic.com>
@dcramer dcramer merged commit 080d8bd into main Oct 31, 2025
14 checks passed
@dcramer dcramer deleted the fix-logs branch October 31, 2025 07:53
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