mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2025-12-23 06:30:05 +00:00
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:
@@ -47,7 +47,7 @@ use serde_json::Value;
|
||||
use session::context::{QueryContext, QueryContextRef};
|
||||
use snafu::{Location, OptionExt, ResultExt};
|
||||
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;
|
||||
@@ -1143,13 +1143,14 @@ async fn retrieve_table_names(
|
||||
|
||||
while let Some(table) = tables_stream.next().await {
|
||||
let table = table.context(CatalogSnafu)?;
|
||||
if table
|
||||
if !table
|
||||
.table_info()
|
||||
.meta
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
@@ -1109,9 +1109,7 @@ pub async fn test_prom_http_api(store_type: StorageType) {
|
||||
"demo_metrics",
|
||||
"demo_metrics_with_nanos",
|
||||
"logic_table",
|
||||
"mito",
|
||||
"multi_labels",
|
||||
"numbers"
|
||||
]))
|
||||
.unwrap()
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user