Skip to content

fix(telemetry_processor): flush buffered telemetry on shutdown - #1204

Merged
solnic merged 2 commits into
masterfrom
fix/telemetry-processor-shutdown-flush
Sep 14, 2026
Merged

solnic merged 2 commits into
masterfrom
fix/telemetry-processor-shutdown-flush

Conversation

@solnic

@solnic solnic commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Now Sentry flushes buffered telemetry during graceful application shutdown, before the telemetry processor and HTTP client stop.

The flush waits up to five seconds before allowing shutdown to continue.

This is to conform to the spec's requirement:

When the application shuts down gracefully, the telemetry buffer MUST forward all data in memory to the telemetry scheduler.

See https://develop.sentry.dev/sdk/foundations/processing/telemetry-processor/#data-forwarding-scenarios

@solnic
solnic force-pushed the fix/telemetry-processor-shutdown-flush branch 5 times, most recently from 1f0d7d9 to 37f3981 Compare September 10, 2026 11:45
@solnic
solnic marked this pull request as ready for review September 10, 2026 11:57
@solnic
solnic force-pushed the fix/telemetry-processor-shutdown-flush branch from 37f3981 to d530733 Compare September 10, 2026 12:05
Comment thread lib/sentry/test.ex Outdated
@solnic
solnic force-pushed the fix/telemetry-processor-shutdown-flush branch from d530733 to 4548b1a Compare September 11, 2026 09:52
Now the envelope collector accepts a response callback to simulate delayed
or failed HTTP responses while still capturing requests.
Now Sentry flushes buffered telemetry during graceful application shutdown,
before the telemetry processor and HTTP client stop.

The flush waits up to five seconds before allowing shutdown to continue.
@solnic
solnic force-pushed the fix/telemetry-processor-shutdown-flush branch from 4548b1a to a337bbd Compare September 11, 2026 12:58
@solnic
solnic requested a review from whatyouhide September 11, 2026 12:59
@solnic
solnic merged commit 3d4c55a into master Sep 14, 2026
16 checks passed
@solnic
solnic deleted the fix/telemetry-processor-shutdown-flush branch September 14, 2026 12:09
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.

3 participants