Skip to content

Commit d3b51c2

Browse files
onewlandclaude
andcommitted
feat(consumer): Emit batch_write_bytes metric from RowBinary writer
The RowBinary writer was missing the insertions.batch_write_bytes counter that the JSONEachRow writer already emits. Adding it here so we can observe batch byte sizes across all eap_items consumers (s4s2/de use RowBinary) as part of Phase 0 of the byte-based batching rollout. Refs EAP-460 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d81ec12 commit d3b51c2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

rust_snuba/src/strategies/clickhouse/row_binary_writer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ where
7979
Box::pin(async move {
8080
let (empty_message, insert_batch) = message.take();
8181
let batch_len = insert_batch.len();
82+
let num_bytes = insert_batch.num_bytes();
8283
let (rows, empty_batch) = insert_batch.take();
8384

8485
let write_start = SystemTime::now();
@@ -126,6 +127,7 @@ where
126127
}
127128
}
128129

130+
counter!("insertions.batch_write_bytes", num_bytes as i64);
129131
counter!("insertions.batch_write_msgs", batch_len as i64);
130132
empty_batch.record_message_latency();
131133
empty_batch.emit_item_type_metrics();

0 commit comments

Comments
 (0)