feat: only show prometheus logical tables for __name__ values query (#6814)

feat: only show prometheus logical tables for __name__ query

Signed-off-by: Ning Sun <sunning@greptime.com>
This commit is contained in:
Ning Sun
2025-08-25 23:04:42 +08:00
committed by GitHub
parent 48572d18a8
commit 69eed2c3fa
2 changed files with 4 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ use serde_json::Value;
use session::context::{QueryContext, QueryContextRef}; use session::context::{QueryContext, QueryContextRef};
use snafu::{Location, OptionExt, ResultExt}; use snafu::{Location, OptionExt, ResultExt};
use store_api::metric_engine_consts::{ use store_api::metric_engine_consts::{
DATA_SCHEMA_TABLE_ID_COLUMN_NAME, DATA_SCHEMA_TSID_COLUMN_NAME, PHYSICAL_TABLE_METADATA_KEY, DATA_SCHEMA_TABLE_ID_COLUMN_NAME, DATA_SCHEMA_TSID_COLUMN_NAME, LOGICAL_TABLE_METADATA_KEY,
}; };
pub use super::result::prometheus_resp::PrometheusJsonResponse; pub use super::result::prometheus_resp::PrometheusJsonResponse;
@@ -1143,13 +1143,14 @@ async fn retrieve_table_names(
while let Some(table) = tables_stream.next().await { while let Some(table) = tables_stream.next().await {
let table = table.context(CatalogSnafu)?; let table = table.context(CatalogSnafu)?;
if table if !table
.table_info() .table_info()
.meta .meta
.options .options
.extra_options .extra_options
.contains_key(PHYSICAL_TABLE_METADATA_KEY) .contains_key(LOGICAL_TABLE_METADATA_KEY)
{ {
// skip non-prometheus (non-metricengine) tables for __name__ query
continue; continue;
} }

View File

@@ -1109,9 +1109,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
"demo_metrics", "demo_metrics",
"demo_metrics_with_nanos", "demo_metrics_with_nanos",
"logic_table", "logic_table",
"mito",
"multi_labels", "multi_labels",
"numbers"
])) ]))
.unwrap() .unwrap()
); );