Package Usage: go: github.com/smira/go-statsd
Package statsd implements high-performance, zero-allocation statsd client.
Go statsd client library with zero allocation overhead, great performance and automatic
reconnects.
With statsd architecture aggregation is performed on statsd server side (e.g. using
high-performance servers like statsite), so application emits many metrics per user action.
Performance of statsd client library is critical to introduce as little overhead as possible.
Client has zero memory allocation per metric being sent, architecture is the following:
Ideas were borrowed from the following stastd clients:
Initialize client instance with options, one client per application is usually enough:
Send metrics as events happen in the application, metrics will be packed together and
delivered to statsd server:
Shutdown client during application shutdown to flush all the pending metrics:
Metrics could be tagged to support aggregation on TSDB side. go-statsd supports
tags in InfluxDB and Datadog formats. Format and default tags (applied to every
metric) are passed as options to the client initialization:
For every metric sent, tags could be added as the last argument(s) to the function
call:
10 versions
Latest release: almost 2 years ago
90 dependent packages
View more package details: https://packages.ecosystem.code.gouv.fr/registries/proxy.golang.org/packages/github.com/smira/go-statsd