#metrics #timer #graphite #statsd #prometheus #logging-framework


Fast, all-purpose metrics library decoupling instrumentation from reporting backends. Like logging frameworks but with counters, timers and gauges. Supports combined outputs (e.g. log + graphite), sampling, aggregation, scheduled push, etc.

52 releases

0.9.1 Jan 16, 2023
0.9.0 May 25, 2020
0.8.0 May 15, 2020
0.7.11 Aug 30, 2019
0.4.11 Nov 29, 2017

#96 in Debugging

Download history 38/week @ 2023-12-23 3190/week @ 2023-12-30 3995/week @ 2024-01-06 3338/week @ 2024-01-13 7272/week @ 2024-01-20 4169/week @ 2024-01-27 5498/week @ 2024-02-03 7526/week @ 2024-02-10 1261/week @ 2024-02-17 8471/week @ 2024-02-24 2643/week @ 2024-03-02 6644/week @ 2024-03-09 5953/week @ 2024-03-16 9426/week @ 2024-03-23 13361/week @ 2024-03-30 1591/week @ 2024-04-06

32,049 downloads per month
Used in 2 crates



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.


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 and many examples 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)
  • 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. Performance, safety and ergonomy are also prime concerns.


Dipstick's focus is on metrics collection (input) and forwarding (output). Although it will happily aggregate base statistics, for the sake of simplicity and performance 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:

use dipstick::*;

fn main() {
    let bucket = AtomicBucket::new();
    let counter = bucket.counter("counter_a");

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

use dipstick::*;

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

fn main() {

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.9.0"

External features

Configuring dipstick from a text file is possible using the spirit-dipstick crate.


When building the crate prior to PR or release, just run plain old make. This will in turn run cargo a few times to run tests, benchmarks, lints, etc. Unfortunately, nightly Rust is still required to run bench and clippy.

TODO / Missing / Weak points

  • Prometheus support is still primitive (read untested). Only the push gateway approach is supported for now.
  • No backend for "pull" metrics yet. Should at least provide tiny-http listener capability.
  • No quick integration feature with common frameworks (Actix, etc.) is provided yet.
  • Thread Local buckets could be nice.
  • "Rolling" aggregators would be nice for pull metrics. Current bucket impl resets after flush.


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


~149K SLoC