mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 18:55:32 +00:00
udp: add prometheus support
This commit is contained in:
parent
e4b7c8451d
commit
5276a919da
6 changed files with 122 additions and 22 deletions
|
|
@ -141,6 +141,21 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
|
|||
let state = state.clone();
|
||||
let config = config.clone();
|
||||
|
||||
#[cfg(feature = "prometheus")]
|
||||
if config.statistics.run_prometheus_endpoint {
|
||||
use metrics_exporter_prometheus::PrometheusBuilder;
|
||||
|
||||
PrometheusBuilder::new()
|
||||
.with_http_listener(config.statistics.prometheus_endpoint_address)
|
||||
.install()
|
||||
.with_context(|| {
|
||||
format!(
|
||||
"Install prometheus endpoint on {}",
|
||||
config.statistics.prometheus_endpoint_address
|
||||
)
|
||||
})?;
|
||||
}
|
||||
|
||||
Builder::new()
|
||||
.name("statistics".into())
|
||||
.spawn(move || {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue