diff --git a/bkmonitor-timeseries-datasource/src/components/query-editor.tsx b/bkmonitor-timeseries-datasource/src/components/query-editor.tsx index d696a8f..0aefddf 100644 --- a/bkmonitor-timeseries-datasource/src/components/query-editor.tsx +++ b/bkmonitor-timeseries-datasource/src/components/query-editor.tsx @@ -184,20 +184,34 @@ export default class MonitorQueryEditor extends React.PureComponent item.value), + page: 1, + page_size: 1, }) - .then((metricList) => { - const metric = metricList.find(set => set.metric_field === item.metric_field - && ((item.data_label && set.data_label === item.data_label) || set.result_table_id === (item.result_table_id || ''))); + .then(({ metric_list }) => { + const metric = metric_list?.[0] || {}; const newMetric: IMetric = { ...item, ...metric,