mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-06 13:22:57 +00:00
fix: post process result on query full column name of prom labels API (#3793)
* fix: post process result on query full column name of prom labels API Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * only preserve tag column Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -463,15 +463,19 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
assert_eq!(body.status, "success");
|
||||
assert_eq!(
|
||||
body.data,
|
||||
serde_json::from_value::<PrometheusResponse>(json!([
|
||||
"__name__", "cpu", "host", "memory", "ts"
|
||||
]))
|
||||
.unwrap()
|
||||
serde_json::from_value::<PrometheusResponse>(json!(["__name__", "host",])).unwrap()
|
||||
);
|
||||
|
||||
// labels without match[] param
|
||||
let res = client.get("/v1/prometheus/api/v1/labels").send().await;
|
||||
assert_eq!(res.status(), StatusCode::OK);
|
||||
let body = serde_json::from_str::<PrometheusJsonResponse>(&res.text().await).unwrap();
|
||||
assert_eq!(body.status, "success");
|
||||
assert_eq!(
|
||||
body.data,
|
||||
serde_json::from_value::<PrometheusResponse>(json!(["__name__", "host", "number",]))
|
||||
.unwrap()
|
||||
);
|
||||
|
||||
// labels query with multiple match[] params
|
||||
let res = client
|
||||
|
||||
Reference in New Issue
Block a user