diff --git a/fly.toml b/fly.toml index ab6723dc..5eee0130 100644 --- a/fly.toml +++ b/fly.toml @@ -26,6 +26,6 @@ kill_timeout = 5 soft_limit = 1024 type = "connections" -# [metrics] -# path = "/metrics" -# port = 9091 + [metrics] + path = "/metrics" + port = 9091 diff --git a/prometheus.yml b/prometheus.yml deleted file mode 100644 index f187379e..00000000 --- a/prometheus.yml +++ /dev/null @@ -1,13 +0,0 @@ -global: - scrape_interval: 15s # By default, scrape targets every 15 seconds. - -scrape_configs: - # The job name is added as a label `job=` to any timeseries scraped from this config. - - job_name: 'prometheus' - scrape_interval: 5s - static_configs: - - targets: ['localhost:9090'] - - - job_name: 'lite-rpc' - static_configs: - - targets: ['localhost:9500'] diff --git a/src/workers/prometheus.rs b/src/workers/prometheus.rs index 036c2e19..069de9ce 100644 --- a/src/workers/prometheus.rs +++ b/src/workers/prometheus.rs @@ -28,7 +28,7 @@ impl PrometheusSync { async fn handle_stream(&self, stream: &mut TcpStream) -> anyhow::Result<()> { let metrics = self.metrics_capture.get_metrics().await; - let metrics = serde_prometheus::to_string(&metrics, None, HashMap::new())?; + let metrics = serde_prometheus::to_string(&metrics, Some("literpc"), HashMap::new())?; let response = Self::create_response(&metrics); @@ -43,7 +43,7 @@ impl PrometheusSync { pub fn sync(self) -> JoinHandle> { #[allow(unreachable_code)] tokio::spawn(async move { - let listener = TcpListener::bind("[::]:9500").await?; + let listener = TcpListener::bind("[::]:9091").await?; loop { let Ok((mut stream, _addr)) = listener.accept().await else {