mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-04 12:22:55 +00:00
fix: return metric name instead of query in Prometheus /series API (#3864)
* fix: return metric name instead of query in Prometheus /series API Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * omit non-tag columns from result Signed-off-by: Ruihang Xia <waynestxia@gmail.com> * fix clippy Signed-off-by: Ruihang Xia <waynestxia@gmail.com> --------- Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -492,7 +492,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
|
||||
// series
|
||||
let res = client
|
||||
.get("/v1/prometheus/api/v1/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);
|
||||
@@ -508,10 +508,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
.collect::<BTreeMap<String, String>>();
|
||||
let expected = BTreeMap::from([
|
||||
("__name__".to_string(), "demo".to_string()),
|
||||
("ts".to_string(), "1970-01-01 00:00:00+0000".to_string()),
|
||||
("cpu".to_string(), "1.1".to_string()),
|
||||
("host".to_string(), "host1".to_string()),
|
||||
("memory".to_string(), "2.2".to_string()),
|
||||
]);
|
||||
assert_eq!(actual, expected);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user