StatsD · AsyncAPI Specification
StatsD Wire Protocol
Version 1.0.0
The StatsD wire protocol: a UTF-8, line-oriented, UDP-by-default text format used by application code to push metrics to a StatsD daemon for in-memory aggregation. Each datagram contains one or more lines of the form `bucket:value|type[|@sample_rate]`. UDP is the canonical transport (port 8125); TCP is also supported when each metric is terminated by `\n`.
StatsD Wire Protocol is an event-driven AsyncAPI specification published by StatsD on the APIs.io network, version 1.0.0.
The spec defines 1 channel, 7 message types, transport over UDP AND TCP.
Tagged areas include Aggregation, Daemon, DogStatsD, Line Protocol, and Metrics.
View Spec
View on GitHub
AggregationDaemonDogStatsDLine ProtocolMetricsObservabilityOpen SourceStatsDTCPUDPWire ProtocolAsyncAPIWebhooksEvents
Channels
metricsIngest
Single ingest channel — every StatsD metric flows over the same UDP/TCP port. The bucket name in the line payload is the de facto routing key.
Messages
Counter
Counter Metric
Counter Metric
Gauge
Gauge Metric
Gauge Metric
Timer
Timer Metric
Timer Metric
Histogram
Histogram Metric
Histogram Metric
Set
Set Metric
Set Metric
Meter
Meter Metric
Meter Metric
MultiMetric
Multi-Metric Packet
Multi-Metric Packet
Servers
udp
udp
Default StatsD UDP listener. One UDP packet contains at least one StatsD metric; multiple metrics may share a packet if separated by `\n`. Packets are fire-and-forget; no acknowledgement is returned.
tcp
tcp
Optional StatsD TCP listener. Metrics may span multiple TCP segments; each metric MUST be terminated by `\n`. No protocol-level acknowledgement.