Skip to content

fix: Fix autocomplete for adhoc filters for grafana v11.x #148

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

UN0wen
Copy link

@UN0wen UN0wen commented Apr 8, 2025

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

@rdettai
Copy link
Collaborator

rdettai commented Apr 8, 2025

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 😞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

adhoc filter seems to be broken on Grafana v11.4.0
2 participants