# StatsD Wire Protocol

**Canonical:** https://apis.io/apis/statsd/statsd-wire-protocol/  
**Provider:** StatsD — https://apis.io/providers/statsd/  
**Documentation:** https://github.com/statsd/statsd/blob/master/docs/metric_types.md

StatsD Wire Protocol is one of 8 APIs that [StatsD](https://apis.io/providers/statsd/) publishes on the [APIs.io](https://apis.io/) network, described by an AsyncAPI event-driven specification. This API exposes 3 JSON Schema definitions. Tagged areas include Counters, Gauges, Histograms, Line Protocol, and Meters. The published artifact set on APIs.io includes API documentation, a GitHub repository, an AsyncAPI specification, a JSON-LD context, and 3 JSON Schemas.

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.

## Machine-readable artifacts (10)

- **Documentation** — https://github.com/statsd/statsd/blob/master/docs/metric_types.md
- **ProtocolSpec** — https://github.com/b/statsd_spec
- **GitHubRepository** — https://github.com/statsd/statsd
- **AsyncAPI** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/asyncapi/statsd-wire-protocol-asyncapi.yml
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/json-schema/statsd-metric-line-schema.json
- **JSONSchema** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/json-schema/statsd-metric-instance-schema.json
- **JSONStructure** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/json-structure/statsd-metric-instance-structure.json
- **JSONLD** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/json-ld/statsd-context.jsonld
- **Vocabulary** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/vocabulary/statsd-vocabulary.yml
- **APIsJSON** — https://raw.githubusercontent.com/api-evangelist/statsd/refs/heads/main/apis.yml

## Other StatsD APIs (7)

- [DogStatsD Wire Protocol](https://apis.io/apis/statsd/dogstatsd-wire-protocol/)
- [StatsD Configuration API](https://apis.io/apis/statsd/statsd-configuration-api/)
- [StatsD Counters API](https://apis.io/apis/statsd/statsd-counters-api/)
- [StatsD Gauges API](https://apis.io/apis/statsd/statsd-gauges-api/)
- [StatsD Health API](https://apis.io/apis/statsd/statsd-health-api/)
- [StatsD Stats API](https://apis.io/apis/statsd/statsd-stats-api/)
- [StatsD Timers API](https://apis.io/apis/statsd/statsd-timers-api/)

## Tags

Counters, Gauges, Histograms, Line Protocol, Meters, Metrics, Sets, Timers, UDP, Wire Protocol

---

Profiled by [API Evangelist](https://apievangelist.com) and published on [APIs.io](https://apis.io/apis/statsd/statsd-wire-protocol/). The API's provider profile, Kin Score and agent-readiness rating are at https://apis.io/providers/statsd/.
