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.
This commit is contained in:
Nils Andreas Svee committed 2026-04-13 17:36:30 +07:00
1 parent 1d7fd5800b
commit e7cbdbb265
1 file changed
+4
+4
View File
@@ -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 {