From e7cbdbb265a5f96419a3e3235ca4f96cc5f13adc Mon Sep 17 00:00:00 2001 From: Nils Andreas Svee Date: Mon, 13 Apr 2026 17:36:30 +0700 Subject: [PATCH] docs(observability): document rationale for unbatched UDP metric flushing Explain that individual metric delivery prevents data truncation caused by small UDP receive buffers on the remote host. --- src/metrics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/metrics.rs b/src/metrics.rs index ec11219..d77828b 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -186,6 +186,10 @@ impl Metrics { fn flush(&self, transport: &mut Transport, batch: &[Metric], host_tag: &str) { match transport { + /* + * the UDP receive buffer might be too small on the receiver to accept batched data, + * and it'll get cutoff in the middle of a record. so send metrics directly on UDP + */ Transport::Udp(_) => { let mut data = String::with_capacity(300); for metric in batch {