influxdb: influxql: better tag-value filtering (#36570)

This commit is contained in:
Gábor Farkas
2021-07-12 07:55:10 +02:00
committed by GitHub
parent e19c690426
commit cc460110b1
2 changed files with 3 additions and 2 deletions

View File

@@ -130,7 +130,7 @@ export const Editor = (props: Props): JSX.Element => {
onChange={handleTagsSectionChange}
getTagKeyOptions={getTagKeys}
getTagValueOptions={(key: string) =>
withTemplateVariableOptions(getTagValues(key, measurement, policy, datasource))
withTemplateVariableOptions(getTagValues(key, measurement, policy, query.tags ?? [], datasource))
}
/>
</SectionWrap>

View File

@@ -45,9 +45,10 @@ export async function getTagValues(
tagKey: string,
measurement: string | undefined,
policy: string | undefined,
tags: InfluxQueryTag[],
datasource: InfluxDatasource
): Promise<string[]> {
const target = { tags: [], measurement, policy };
const target = { tags, measurement, policy };
const data = await runExploreQuery('TAG_VALUES', tagKey, undefined, target, datasource);
return data.map((item) => item.text);
}