mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
influxdb: influxql: better tag-value filtering (#36570)
This commit is contained in:
@@ -130,7 +130,7 @@ export const Editor = (props: Props): JSX.Element => {
|
|||||||
onChange={handleTagsSectionChange}
|
onChange={handleTagsSectionChange}
|
||||||
getTagKeyOptions={getTagKeys}
|
getTagKeyOptions={getTagKeys}
|
||||||
getTagValueOptions={(key: string) =>
|
getTagValueOptions={(key: string) =>
|
||||||
withTemplateVariableOptions(getTagValues(key, measurement, policy, datasource))
|
withTemplateVariableOptions(getTagValues(key, measurement, policy, query.tags ?? [], datasource))
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</SectionWrap>
|
</SectionWrap>
|
||||||
|
|||||||
@@ -45,9 +45,10 @@ export async function getTagValues(
|
|||||||
tagKey: string,
|
tagKey: string,
|
||||||
measurement: string | undefined,
|
measurement: string | undefined,
|
||||||
policy: string | undefined,
|
policy: string | undefined,
|
||||||
|
tags: InfluxQueryTag[],
|
||||||
datasource: InfluxDatasource
|
datasource: InfluxDatasource
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
const target = { tags: [], measurement, policy };
|
const target = { tags, measurement, policy };
|
||||||
const data = await runExploreQuery('TAG_VALUES', tagKey, undefined, target, datasource);
|
const data = await runExploreQuery('TAG_VALUES', tagKey, undefined, target, datasource);
|
||||||
return data.map((item) => item.text);
|
return data.map((item) => item.text);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user