mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
OpenSearch: Add timeRange to parameters passed to getTagValues (#74952)
This commit is contained in:
parent
da23aef83d
commit
4cc72a22ad
@ -2,6 +2,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import { AdHocVariableFilter, DataSourceRef, MetricFindValue, SelectableValue } from '@grafana/data';
|
import { AdHocVariableFilter, DataSourceRef, MetricFindValue, SelectableValue } from '@grafana/data';
|
||||||
import { SegmentAsync } from '@grafana/ui';
|
import { SegmentAsync } from '@grafana/ui';
|
||||||
|
import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';
|
||||||
|
|
||||||
import { getDatasourceSrv } from '../../../plugins/datasource_srv';
|
import { getDatasourceSrv } from '../../../plugins/datasource_srv';
|
||||||
|
|
||||||
@ -51,8 +52,9 @@ const fetchFilterValues = async (
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const timeRange = getTimeSrv().timeRange();
|
||||||
// Filter out the current filter key from the list of all filters
|
// Filter out the current filter key from the list of all filters
|
||||||
const otherFilters = allFilters.filter((f) => f.key !== key);
|
const otherFilters = allFilters.filter((f) => f.key !== key);
|
||||||
const metrics = await ds.getTagValues({ key, filters: otherFilters });
|
const metrics = await ds.getTagValues({ key, filters: otherFilters, timeRange });
|
||||||
return metrics.map((m: MetricFindValue) => ({ label: m.text, value: m.text }));
|
return metrics.map((m: MetricFindValue) => ({ label: m.text, value: m.text }));
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user