Go to file
Francis Lalonde 0b61c01550 template from vec 2018-10-18 09:31:53 -04:00
assets Split Name and Namespace to separate module 2018-10-03 14:01:53 -04:00
examples template from vec 2018-10-18 09:31:53 -04:00
handbook Save scopes 2018-10-17 16:43:08 -04:00
schema Adding protobuf prometheus 2018-06-24 09:54:11 -04:00
src template from vec 2018-10-18 09:31:53 -04:00
tests TLS Mock Clock for tests 2018-05-25 12:28:01 -04:00
.directory Raw Bridge 2018-06-21 16:28:25 -04:00
.gitignore Adding protobuf prometheus 2018-06-24 09:54:11 -04:00
.travis.yml (cargo-release) start next development iteration -1.6.1-alpha.0 2018-01-10 09:21:04 -05:00
CHANGES.md Registry dissolved 2018-03-28 17:00:35 -04:00
CODE_OF_CONDUCT.md for great justice 2018-01-09 16:43:32 -05:00
CONTRIBUTING.md Use ::*, nice README and CONTRIBUTING, AsSink / AsSource 2017-08-21 15:31:52 -04:00
Cargo.toml Save scopes 2018-10-17 16:43:08 -04:00
LICENSE-APACHE Revise some doc and license 2017-08-31 01:02:12 -04:00
LICENSE-MIT Revise some doc and license 2017-08-31 01:02:12 -04:00
Makefile Applied some clippy recommendations 2018-10-04 13:13:55 -04:00
README.md Split Name and Namespace to separate module 2018-10-03 14:01:53 -04:00
README.md.skt.md Reenable feature gated skpetic 2018-05-10 13:06:36 -04:00
build.rs Updating README 2018-09-19 16:40:08 -04:00

README.md

crates.io docs.rs Build Status

dipstick a dipstick picture

A one-stop shop metrics library for Rust applications with lots of features,
minimal impact on applications and a choice of output to downstream systems.

Features

Dipstick is a toolkit to help all sorts of application collect and send out metrics. As such, it needs a bit of set up to suit one's needs. Skimming through the handbook handbook should help you get an idea of the possible configurations.

In short, dipstick-enabled apps can:

  • Send metrics to console, log, statsd, graphite or prometheus (one or many)
  • Serve metrics over HTTP
  • Locally aggregate the count, sum, mean, min, max and rate of metric values
  • Publish aggregated metrics, on schedule or programmatically
  • Customize output statistics and formatting
  • Define global or scoped (e.g. per request) metrics
  • Statistically sample metrics (statsd)
  • Choose between sync or async operation
  • Choose between buffered or immediate output
  • Switch between metric backends at runtime

For convenience, dipstick builds on stable Rust with minimal, feature-gated dependencies.

Non-goals

For performance reasons, dipstick will not

  • plot graphs
  • send alerts
  • track histograms

These are all best done by downstream timeseries visualization and monitoring tools.

Show me the code!

Here's a basic aggregating & auto-publish counter metric:

let bucket = Bucket::new();
bucket.set_target(Text::output(io::stdout()));
bucket.flush_every(Duration::from_secs(3));
let counter = bucket.counter("counter_a");
counter.count(8)

Persistent apps wanting to declare static metrics will prefer using the metrics! macro:

metrics! { METRICS = "my_app" =>
    pub COUNTER: Counter = "my_counter";
}

fn main() {
    METRICS.set_target(Graphite::output("graphite.com:2003").unwrap());
    COUNTER.count(32);
}

For sample applications see the examples. For documentation see the handbook.

To use Dipstick in your project, add the following line to your Cargo.toml in the [dependencies] section:

dipstick = "0.7.0"

License

Dipstick is licensed under the terms of the Apache 2.0 and MIT license.