Skip to content

feat(streams): Add batch flush and GCS write pipeline metrics#312

Merged
fpacifici merged 2 commits intomainfrom
fpacifici/metrics
May 7, 2026
Merged

feat(streams): Add batch flush and GCS write pipeline metrics#312
fpacifici merged 2 commits intomainfrom
fpacifici/metrics

Conversation

@fpacifici
Copy link
Copy Markdown
Collaborator

@fpacifici fpacifici commented May 7, 2026

Expose Rust pipeline behavior to DogStatsD alongside existing streams.pipeline.* stats: each batch flush samples window size and how long the window stayed open, and each successful GCS upload records the written object size.

Batch flush

Batch records created_at when the first row opens the window. On successful flush, we emit histograms streams.pipeline.batch.size (element count) and streams.pipeline.batch.time_ms (milliseconds since the batch opened), tagged with step.

GCS

After a successful upload, we record a histogram sample on streams.pipeline.sink.gcs_writer.bytes for the payload length, tagged with source from the writer route.

Record histograms for batch element count and open duration on flush,
and a gauge for successful GCS object size keyed by route source.

Co-authored-by: Cursor <cursoragent@cursor.com>
Comment thread sentry_streams/src/batch_step.rs Outdated
Comment thread sentry_streams/src/batch_step.rs Outdated
Comment thread sentry_streams/src/gcs_writer.rs Outdated
Comment thread sentry_streams/src/gcs_writer.rs Outdated
- Rename batch size/time metrics; record batch age in milliseconds
- Use histogram for GCS sink bytes; rename to sink.gcs_writer.bytes

Co-authored-by: Cursor <cursoragent@cursor.com>
@fpacifici fpacifici marked this pull request as ready for review May 7, 2026 21:38
@fpacifici fpacifici requested a review from a team as a code owner May 7, 2026 21:38
@fpacifici fpacifici merged commit 1128198 into main May 7, 2026
22 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