MCPcopy Create free account
hub / github.com/Botloader/botloader / setup_metrics

Function setup_metrics

components/common/src/lib.rs:37–49  ·  view source on GitHub ↗
(metrics_listen_addr: &str)

Source from the content-addressed store, hash-verified

35}
36
37pub fn setup_metrics(metrics_listen_addr: &str) {
38 let (recorder, exporter) = PrometheusBuilder::new()
39 .with_http_listener(SocketAddr::from_str(metrics_listen_addr).unwrap())
40 .build()
41 .unwrap();
42
43 metrics::set_global_recorder(recorder).unwrap();
44
45 metrics::gauge!("botloader_build_info", "version" => VERSION).set(1.0);
46
47 info!("exposing metrics at {}", metrics_listen_addr);
48 tokio::spawn(exporter);
49}
50
51// #[derive(Clone)]
52// struct MetricsLabelFilter;

Callers 5

runFunction · 0.85
runFunction · 0.85
runFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 2

buildMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected