Crates.io | metrics_distributor |
lib.rs | metrics_distributor |
version | 0.5.3 |
source | src |
created_at | 2016-02-25 23:57:41.47592 |
updated_at | 2020-04-24 04:16:38.904862 |
description | Ingest logs and forward aggregated data to APIs/services. |
homepage | |
repository | https://github.com/dirk/metrics_distributor |
max_upload_size | |
id | 4292 |
size | 87,489 |
Metrics distributor is a Rust library for streamlining the creation and operation of metrics aggregation services. You can use it to build a simple, multi-protocol collection and forwarding service for your metrics.
Distributors can collect over a number of protocols and formats:
LogDrainHandler
HerokuLogLineReader
StandardLogLineReader
StatsdTcpListener
StatsdUdpListener
They can then forward aggregated metrics over a number of protocols:
DatadogForwarder
The system OpenSSL on macOS is too outdated. To use the one installed by Homebrew, run the following commands before building:
export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include
export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib
export LDFLAGS=-L`brew --prefix openssl`/lib
Distributor uses code as configuration. Rather than parsing a configuration format, you configure your service by composing collectors and forwarders. This means you get the added advantage of the powerful Rust compiler checking your "configuration" for correctness and that it's very easy to customize or create entirely new collections/forwarders.
See the examples/
folder for some common configurations:
http_server.rs
: Simple log drainstatsd_server.rs
: StatsD (UDP) serverIt turns out that the number of lines needed to set up a few collectors and forwarders in code is almost exactly the same as you would need with YAML/TOML/etc.
Licensed under the 3-clause BSD license. See LICENSE for details.