mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
fix prometheus timeout mask metrics
This commit is contained in:
parent
c4f645e03e
commit
40e33d8af1
7 changed files with 15 additions and 7 deletions
|
|
@ -107,6 +107,7 @@ impl CanonicalSocketAddr {
|
|||
pub fn spawn_prometheus_endpoint(
|
||||
addr: SocketAddr,
|
||||
timeout: Option<::std::time::Duration>,
|
||||
timeout_mask: Option<metrics_util::MetricKindMask>,
|
||||
) -> anyhow::Result<::std::thread::JoinHandle<anyhow::Result<()>>> {
|
||||
use std::thread::Builder;
|
||||
use std::time::Duration;
|
||||
|
|
@ -125,8 +126,10 @@ pub fn spawn_prometheus_endpoint(
|
|||
.context("build prometheus tokio runtime")?;
|
||||
|
||||
rt.block_on(async {
|
||||
let mask = timeout_mask.unwrap_or(MetricKindMask::ALL);
|
||||
|
||||
let (recorder, exporter) = PrometheusBuilder::new()
|
||||
.idle_timeout(MetricKindMask::ALL, timeout)
|
||||
.idle_timeout(mask, timeout)
|
||||
.with_http_listener(addr)
|
||||
.build()
|
||||
.context("build prometheus recorder and exporter")?;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue