StatsD Wire Protocol
The StatsD wire protocol is a UTF-8, line-oriented, UDP-by-default packet format used to push application metrics from clients to a StatsD daemon. Each line takes the form `bucket:value|type[|@sample_rate]`, where `type` is one of `c` (counter), `g` (gauge, with optional `+`/`-` for delta), `ms` (timer), `h` (histogram), `s` (set), or `m` (meter, in some dialects). Multiple metrics may share a packet when separated by `\n`. The protocol is connectionless on UDP (port 8125) and connection-oriented on TCP, where each metric MUST be terminated by `\n`. The wire format is the canonical contract between StatsD, its tag-aware dialects (DogStatsD, InfluxDB, SignalFx), and the wider ecosystem of clients and servers.