quickwit-datasource
quickwit-datasource copied to clipboard
fix: Fix autocomplete for adhoc filters for grafana v11.x
fixes #144
My first PR, not too familiar with grafana scenes so I'm not sure where else to test but I've checked adhoc filters autocomplete on Grafana v10.4 and 11.4 and they were working correctly, please let me know if there are more places I should test.
Changes
It seems like we were using one of the optional fields (value) on MetricFindValue to filter for field capabilities, but it seems like from v11.x (not sure which version exactly, I only checked v11.4 mentioned in the issue) Grafana is using the value field as the key for both the final query and the autocomplete for tags, which leads to:
- autocomplete fails because we're getting terms for field
"field" : "string" - final query having
string: <value>which most of the time returns nothing
Fixed this by renaming the field used for field capabilities to type
Thanks for this PR. We are a bit short on maintainers for this plugin lately, so I can't really guaranty when we'll be able to review and merge this. Sorry 😞
Thanks @UN0wen for the report. I'm going to fix this, supporting Grafana 12 is the target.