fix prometheus timeout mask metrics

This commit is contained in:
Joakim Frostegård 2024-02-04 00:03:01 +01:00
parent c4f645e03e
commit 40e33d8af1
7 changed files with 15 additions and 7 deletions

View file

@ -20,7 +20,7 @@ name = "aquatic_ws"
[features]
default = ["prometheus", "mimalloc"]
prometheus = ["metrics", "aquatic_common/prometheus"]
metrics = ["dep:metrics", "metrics-util"]
metrics = ["dep:metrics", "dep:metrics-util"]
# Use mimalloc allocator for much better performance. Requires cmake and a
# C/C++ compiler
mimalloc = ["dep:mimalloc"]
@ -43,9 +43,6 @@ hashbrown = { version = "0.14", features = ["serde"] }
httparse = "1"
indexmap = "2"
log = "0.4"
metrics = { version = "0.22", optional = true }
metrics-util = { version = "0.16", optional = true }
metrics-exporter-prometheus = { version = "0.13", optional = true, default-features = false, features = ["http-listener"] }
mimalloc = { version = "0.1", default-features = false, optional = true }
privdrop = "0.5"
rand = { version = "0.8", features = ["small_rng"] }
@ -58,6 +55,10 @@ slotmap = "1"
socket2 = { version = "0.5", features = ["all"] }
tungstenite = "0.21"
# metrics feature
metrics = { version = "0.22", optional = true }
metrics-util = { version = "0.16", optional = true }
[dev-dependencies]
quickcheck = "1"
quickcheck_macros = "1"

View file

@ -141,6 +141,7 @@ pub fn run(config: Config) -> ::anyhow::Result<()> {
let handle = aquatic_common::spawn_prometheus_endpoint(
config.metrics.prometheus_endpoint_address,
Some(Duration::from_secs(idle_timeout)),
Some(metrics_util::MetricKindMask::GAUGE),
)?;
join_handles.push((WorkerType::Prometheus, handle));