[][src]Macro metrics::increment

macro_rules! increment {
    #[proc_macro_hack] => { ... };
}

Increments a counter by one.

Counters represent a single monotonic value, which means the value can only be incremented, not decremented, and always starts out with an initial value of zero.

Example

// A basic increment:
increment!("some_metric_name");

// Specifying labels:
increment!("some_metric_name", "service" => "http");

// We can also pass labels by giving a vector or slice of key/value pairs:
let dynamic_val = "woo";
let labels = [("dynamic_key", format!("{}!", dynamic_val))];
increment!("some_metric_name", &labels);