diff --git a/src/handler/http/request/prom/mod.rs b/src/handler/http/request/prom/mod.rs index 0acb5f4310..018eccd817 100644 --- a/src/handler/http/request/prom/mod.rs +++ b/src/handler/http/request/prom/mod.rs @@ -38,7 +38,7 @@ use crate::service::promql; (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[post("/{org_id}/prometheus/v1/write")] +#[post("/{org_id}/prometheus/api/v1/write")] pub async fn remote_write( org_id: web::Path, thread_id: web::Data, @@ -100,7 +100,7 @@ pub async fn remote_write( (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[get("/{org_id}/prometheus/v1/query")] +#[get("/{org_id}/prometheus/api/v1/query")] pub async fn query( org_id: web::Path, query: web::Query, @@ -209,7 +209,7 @@ pub async fn query( (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[get("/{org_id}/prometheus/v1/query_range")] +#[get("/{org_id}/prometheus/api/v1/query_range")] pub async fn query_range( org_id: web::Path, range_query: web::Query, @@ -330,7 +330,7 @@ pub async fn query_range( (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[get("/{org_id}/prometheus/v1/metadata")] +#[get("/{org_id}/prometheus/api/v1/metadata")] pub async fn metadata( org_id: web::Path, req: web::Query, @@ -385,7 +385,7 @@ pub async fn metadata( (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[get("/{org_id}/prometheus/v1/series")] +#[get("/{org_id}/prometheus/api/v1/series")] pub async fn series( org_id: web::Path, series: web::Query, @@ -440,7 +440,7 @@ pub async fn series( (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[get("/{org_id}/prometheus/v1/labels")] +#[get("/{org_id}/prometheus/api/v1/labels")] pub async fn labels( org_id: web::Path, labels: web::Query, @@ -477,7 +477,7 @@ pub async fn labels( (status = 500, description="Failure", content_type = "application/json", body = HttpResponse), ) )] -#[get("/{org_id}/prometheus/v1/label/{label_name}/values")] +#[get("/{org_id}/prometheus/api/v1/label/{label_name}/values")] pub async fn values( path: web::Path<(String, String)>, values: web::Query, diff --git a/src/service/router/mod.rs b/src/service/router/mod.rs index 1ea54d6ac8..3ad062136e 100644 --- a/src/service/router/mod.rs +++ b/src/service/router/mod.rs @@ -25,12 +25,12 @@ const QUERIER_ROUTES: [&str; 9] = [ "/_search", "/_around", "/_values", - "/prometheus/v1/series", - "/prometheus/v1/query_range", - "/prometheus/v1/query", - "/prometheus/v1/metadata", - "/prometheus/v1/labels", - "/prometheus/v1/label/", + "/prometheus/api/v1/series", + "/prometheus/api/v1/query_range", + "/prometheus/api/v1/query", + "/prometheus/api/v1/metadata", + "/prometheus/api/v1/labels", + "/prometheus/api/v1/label/", ]; #[inline] diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 7849540947..a91e747fe3 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -963,7 +963,7 @@ mod tests { ) .await; let req = test::TestRequest::post() - .uri(&format!("/api/{}/prometheus/v1/write", "e2e")) + .uri(&format!("/api/{}/prometheus/api/v1/write", "e2e")) .insert_header(("X-Prometheus-Remote-Write-Version", "0.1.0")) .insert_header(("Content-Encoding", "snappy")) .insert_header(("Content-Type", "application/x-protobuf"))