mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
fix!: resolve residual issues with removing prometheus port (#2227)
* fix: resolve residual issues when removing prometheus port * fix: remove prometheus from sample config as well
This commit is contained in:
@@ -344,12 +344,12 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// instant query
|
||||
let res = client
|
||||
.get("/v1/prometheus/query?query=up&time=1")
|
||||
.get("/v1/prometheus/api/v1/query?query=up&time=1")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
let res = client
|
||||
.post("/v1/prometheus/query?query=up&time=1")
|
||||
.post("/v1/prometheus/api/v1/query?query=up&time=1")
|
||||
.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.send()
|
||||
.await;
|
||||
@@ -357,12 +357,12 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// range query
|
||||
let res = client
|
||||
.get("/v1/prometheus/query_range?query=up&start=1&end=100&step=5")
|
||||
.get("/v1/prometheus/api/v1/query_range?query=up&start=1&end=100&step=5")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
let res = client
|
||||
.post("/v1/prometheus/query_range?query=up&start=1&end=100&step=5")
|
||||
.post("/v1/prometheus/api/v1/query_range?query=up&start=1&end=100&step=5")
|
||||
.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.send()
|
||||
.await;
|
||||
@@ -370,18 +370,18 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// labels
|
||||
let res = client
|
||||
.get("/v1/prometheus/labels?match[]=demo")
|
||||
.get("/v1/prometheus/api/v1/labels?match[]=demo")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
let res = client
|
||||
.post("/v1/prometheus/labels?match[]=up")
|
||||
.post("/v1/prometheus/api/v1/labels?match[]=up")
|
||||
.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
let res = client
|
||||
.get("/v1/prometheus/labels?match[]=demo&start=0")
|
||||
.get("/v1/prometheus/api/v1/labels?match[]=demo&start=0")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
@@ -396,17 +396,17 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
);
|
||||
|
||||
// labels without match[] param
|
||||
let res = client.get("/v1/prometheus/labels").send().await;
|
||||
let res = client.get("/v1/prometheus/api/v1/labels").send().await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
|
||||
// labels query with multiple match[] params
|
||||
let res = client
|
||||
.get("/v1/prometheus/labels?match[]=up&match[]=down")
|
||||
.get("/v1/prometheus/api/v1/labels?match[]=up&match[]=down")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
let res = client
|
||||
.post("/v1/prometheus/labels?match[]=up&match[]=down")
|
||||
.post("/v1/prometheus/api/v1/labels?match[]=up&match[]=down")
|
||||
.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.send()
|
||||
.await;
|
||||
@@ -414,7 +414,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// series
|
||||
let res = client
|
||||
.get("/v1/prometheus/series?match[]=demo&start=0&end=0")
|
||||
.get("/v1/prometheus/api/v1/series?match[]=demo&start=0&end=0")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
@@ -438,7 +438,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
assert_eq!(actual, expected);
|
||||
|
||||
let res = client
|
||||
.post("/v1/prometheus/series?match[]=up&match[]=down")
|
||||
.post("/v1/prometheus/api/v1/series?match[]=up&match[]=down")
|
||||
.header("Content-Type", "application/x-www-form-urlencoded")
|
||||
.send()
|
||||
.await;
|
||||
@@ -447,7 +447,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
// label values
|
||||
// should return error if there is no match[]
|
||||
let res = client
|
||||
.get("/v1/prometheus/label/instance/values")
|
||||
.get("/v1/prometheus/api/v1/label/instance/values")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
@@ -458,7 +458,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// single match[]
|
||||
let res = client
|
||||
.get("/v1/prometheus/label/host/values?match[]=demo&start=0&end=600")
|
||||
.get("/v1/prometheus/api/v1/label/host/values?match[]=demo&start=0&end=600")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
@@ -471,7 +471,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// multiple match[]
|
||||
let res = client
|
||||
.get("/v1/prometheus/label/instance/values?match[]=up&match[]=system_metrics")
|
||||
.get("/v1/prometheus/api/v1/label/instance/values?match[]=up&match[]=system_metrics")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
@@ -482,7 +482,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// query `__name__` without match[]
|
||||
let res = client
|
||||
.get("/v1/prometheus/label/__name__/values")
|
||||
.get("/v1/prometheus/api/v1/label/__name__/values")
|
||||
.send()
|
||||
.await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
|
||||
Reference in New Issue
Block a user