g3/g3statsd
Zhang Jingqiang 350eec3f8a
Some checks are pending
CodeCoverage / g3statsd test (push) Waiting to run
CodeCoverage / lib unit test (push) Waiting to run
CodeCoverage / g3proxy test (push) Waiting to run
CodeCoverage / g3bench test (push) Waiting to run
CrossCompiling / Build (push) Waiting to run
Linux-CI / Build (push) Waiting to run
Linux-CI / Clippy (push) Waiting to run
Linux-CI / Build vendored (push) Waiting to run
Linux-CI / Build with OpenSSL Async Job (push) Waiting to run
MacOS-CI / Build (push) Waiting to run
MacOS-CI / Build vendored (push) Waiting to run
StaticLinking / musl (push) Waiting to run
StaticLinking / msvc (push) Waiting to run
Windows-CI / Build (push) Waiting to run
Windows-CI / Build vendored (push) Waiting to run
fix clippy 1.89 warning
2025-06-27 10:55:11 +08:00
..
debian bum deb compat to 13 2025-05-16 15:48:45 +08:00
examples g3statsd: allow to listen to unix statsd socket 2025-06-02 15:43:55 +08:00
proto update packages and ignore warning in generated code 2025-06-27 10:55:11 +08:00
service g3statsd version 0.1.0 2025-05-13 21:25:13 +08:00
src fix clippy 1.89 warning 2025-06-27 10:55:11 +08:00
utils/ctl switch to use SPDX license identifier and update copyright year 2025-05-16 18:30:35 +08:00
build.rs switch to use SPDX license identifier and update copyright year 2025-05-16 18:30:35 +08:00
Cargo.toml g3statsd: switch to use http in opentsdb exporter 2025-05-05 21:30:12 +08:00
CHANGELOG g3statsd: add package files 2025-05-12 15:42:01 +08:00
g3statsd.spec g3statsd version 0.1.0 2025-05-13 21:25:13 +08:00
README.md update doc 2025-06-18 12:01:16 +08:00

docs

g3statsd

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.

Building

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-ctl

To build release binaries:

cargo build --profile release-lto -p g3statsd -p g3statsd-ctl

See Build and Package if you want to build binary packages or docker images.

Supported Metric Types

  • c - COUNT
  • g - GAUGE
  • h - HISTOGRAM (unsupported yet)
  • ms - TIMER (unsupported yet)

Supported Importers

  • statsd

    Accept StatsD metrics, and send them to collectors.

    Only UDP is supported at this time.

Supported Collectors

  • aggregate

    Aggregate received metrics and send them to exporters.

    You can set join_tags in 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

Supported Exporters

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

Documents

You can view the reference documentation generated by sphinx online at Read the Docs.

Examples

You can find example config in the examples directory.