Skip to content

Commit c325ba5

Browse files
authored
ref(instr): Count contained items instead of raw envelope items (#4741)
Count the logical amount of items instead of the raw items in the envelop items metric.
1 parent a6f2bae commit c325ba5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

relay-server/src/endpoints/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ fn emit_envelope_metrics(envelope: &Envelope) {
410410
item_type = item.ty().name()
411411
);
412412
metric!(
413-
counter(RelayCounters::EnvelopeItems) += 1,
413+
counter(RelayCounters::EnvelopeItems) += item.item_count().unwrap_or(1),
414414
item_type = item.ty().name(),
415415
sdk = client_name.name(),
416416
);

relay-server/src/statsd.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,10 @@ pub enum RelayCounters {
678678
/// - `handling`: Either `"success"` if the envelope was handled correctly, or `"failure"` if
679679
/// there was an error or bug.
680680
EnvelopeRejected,
681-
/// Number of items we processed per envelope.
681+
/// Number of total envelope items we received.
682+
///
683+
/// Note: This does not count raw items, it counts the logical amount of items,
684+
/// e.g. a single item container counts all its contained items.
682685
EnvelopeItems,
683686
/// Number of bytes we processed per envelope item.
684687
EnvelopeItemBytes,

0 commit comments

Comments
 (0)