g3statsd is statsd-compatible stats aggregator.
It is developed to meet the needs in G3 project as all applications use StatsD as metrics sending protocol.
The features make it different from other statsd server implementations are:
- written in async rust, which make it efficient and safe
- compatible with DogStatsD protocol, tags supported
- each exporter has its own emit interval
- can aggregate gauge metric values when dropping tags
There are still many features missing as the current focus is our internal usage, feel free to submit feature request issues. PRs are also welcomed.
You need to follow the dev-setup guide to set up your build environment first.
To build debug binaries:
cargo build -p g3statsd -p g3statsd-ctlTo build release binaries:
cargo build --profile release-lto -p g3statsd -p g3statsd-ctlSee Build and Package if you want to build binary packages or docker images.
- c - COUNT
- g - GAUGE
- h - HISTOGRAM (unsupported yet)
- ms - TIMER (unsupported yet)
-
statsd
Accept StatsD metrics, and send them to collectors.
Only UDP is supported at this time.
-
aggregate
Aggregate received metrics and send them to exporters.
You can set
join_tagsin this collector to join metrics when drop tags. -
regulate
Make some changes to the received metrics and send directly to exporters.
The supported actions are:
- prefix - add a common name prefix to all metrics
- drop_tags - drop tags for all metrics
| Exporter | Introduction | Aggregate | Global prefix and tags |
|---|---|---|---|
| console | Log all metrics to stdout | no | no |
| discard | Discard all metrics | no | no |
| memory | Store all metrics values in memory | no | no |
| graphite | Emit to graphite by using the plaintext protocol | yes | yes |
| opentsdb | Emit to OpenTSDB by using the /api/put API | yes | yes |
| influxdb_v2 | Emit to InfluxDB v2 by using the /api/v2/write API | yes | yes |
| influxdb_v3 | Emit to InfluxDB v3 by using the /api/v3/write_lp API | yes | yes |
You can view the reference documentation generated by sphinx online at Read the Docs.
You can find example config in the examples directory.