fixed comments left by pan in #40

This commit is contained in:
aniketfuryrocks 2023-01-29 05:15:16 +05:30
parent ff972fae48
commit 380afef80b
No known key found for this signature in database
GPG Key ID: FA6BFCFAA7D4B764
3 changed files with 5 additions and 18 deletions

View File

@ -26,6 +26,6 @@ kill_timeout = 5
soft_limit = 1024
type = "connections"
# [metrics]
# path = "/metrics"
# port = 9091
[metrics]
path = "/metrics"
port = 9091

View File

@ -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=<job_name>` 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']

View File

@ -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<anyhow::Result<()>> {
#[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 {