-
Notifications
You must be signed in to change notification settings - Fork 11.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AdhocFilters: Improve typing and signature of getTagKeys and getTagValues and behaviors #74962
Conversation
(Open the links below in a new tab to go to the correct steps)
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with some questions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. Checked the Tempo service graph seems to work. Checked the other code but did not test prom or influx.
…lues and behaviors (#74962) * Add adhocFilters to DataQueryRequest * More changes * Progress * Working * added baseFilters to picker * Remove unused code * minor fix
Started working on adhoc filters for scenes and want to review and try to improve the system.
Goals
templateSrv.getAdhocFilters(this.name);
(not in this PR)Changes
The tempo => adhoc filters => Prometheus thing
To support adhoc filters in the tempo query builder a series[] name array was added to getTagKeys to filter tag keys by some series names. This is too specific to Prometheus. The getTagKeys and getTagValues need to be more generic. So changing this work with the new way of passing in existing filters / baseFilters. Prometheus can filter on multiple series names using regex label matching.
Adding adhocFilters to DataQueryRequest
The PR actually only started with this change, but then noticed the poor typing and flexibility of getTagKeys and getTagValues so switched the PR to addressing that.
So will move this change to a different PR.
Instead of data sources having to call
templateSrv.getAdhocFilters(this.name);
to get the relevant filters to apply to the queries I propose passing them via DataQueryRequest.We would of course make templateSrv.getAdhocFilters(this.name) work for backward compatibility reasons, but going forward using filters passed via the request object is a lot more flexible and clean.
Some tricky questions:
Alternative