raw_log/raw_log.rs
1//! Use the metrics backend directly to log a metric value.
2//! Applications should use the metrics()-provided instruments instead.
3
4use dipstick::{Input, InputScope, labels};
5
6fn main() {
7 raw_write()
8}
9
10pub fn raw_write() {
11 // setup dual metric channels
12 let metrics_log = dipstick::Log::to_log().metrics();
13
14 // define and send metrics using raw channel API
15 let counter = metrics_log.new_metric("count_a".into(), dipstick::InputKind::Counter);
16 counter.write(1, labels![]);
17}