Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@ fn ingest_path() -> String {
"/ingest".to_string()
}

pub fn metrics_path() -> String {
format!("{}/metrics", base_path())
}

fn alert_path(stream_name: &str) -> String {
format!("{}/alert", logstream_path(stream_name))
}
Expand Down
4 changes: 2 additions & 2 deletions server/src/metrics/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use actix_web_prometheus::{PrometheusMetrics, PrometheusMetricsBuilder};
use lazy_static::lazy_static;
use prometheus::{HistogramOpts, HistogramVec, IntCounterVec, IntGaugeVec, Opts, Registry};

use crate::metadata::STREAM_INFO;
use crate::{metadata::STREAM_INFO, metrics_path};

pub const METRICS_NAMESPACE: &str = env!("CARGO_PKG_NAME");

Expand Down Expand Up @@ -87,7 +87,7 @@ pub fn build_metrics_handler() -> PrometheusMetrics {

let prometheus = PrometheusMetricsBuilder::new(METRICS_NAMESPACE)
.registry(registry)
.endpoint("/metrics")
.endpoint(metrics_path().as_str())
.build()
.expect("Prometheus initialization");

Expand Down