Skip to content
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

Migrate to CustomVariableSupport #233

Closed
idastambuk opened this issue Oct 16, 2023 · 1 comment · Fixed by #304
Closed

Migrate to CustomVariableSupport #233

idastambuk opened this issue Oct 16, 2023 · 1 comment · Fixed by #304
Assignees

Comments

@idastambuk
Copy link
Contributor

idastambuk commented Oct 16, 2023

What happened:
As described here, we need to investigate why this happens and reimplement custom variable support.

we need to use metricFindQuery for query variable support, otherwise the variable object resolves to {text: "Demo Wind Farm Asset", value "Demo Wind Farm Asset"}, which is not what we want, since when they are selected in dashboards, their IDs are sent in different types of queries and not their names.

The only time we would need the names is when the variables are being filtered by regex like #154. However, the solution for this in the original commit is just a consequence of the values being the same as names, and not a proper fix.
I will reopen the original ticket, since we will need to reimplement custom variable support.

We should investigate why the values resolve to {text: "Demo Wind Farm Asset", value "Demo Wind Farm Asset"} and not to the assetId. For some reason the variable value in the redux state is equal to its text, for example:
Screenshot 2023-10-16 at 8 54 51 PM

What you expected to happen:
The variable value should have value of the id.
How to reproduce it (as minimally and precisely as possible):

Screenshots

Anything else we need to know?:

Environment:

  • Grafana version:10.2.0
  • Plugin version:1.10.0
  • OS Grafana is installed on:
  • User OS & Browser:
  • Others:
@iwysiu
Copy link
Contributor

iwysiu commented Oct 30, 2023

From investigating the linked athena issue, the problem seems to be that CustomVariableSupport expects data frames with text and value fields. I suspect that the query we're returning doesn't have those fields, so instead it takes the first field (in the example case the name) and uses it for both values. If that is the case, we're going to have to process the results (maybe write resource handlers for them) to get them into the correct formats to be used as variables

@iwysiu iwysiu moved this from Backlog to Next in AWS Datasources Nov 13, 2023
@sarahzinger sarahzinger self-assigned this Nov 29, 2023
@sarahzinger sarahzinger moved this from Next to In Progress in AWS Datasources Nov 29, 2023
@sarahzinger sarahzinger removed their assignment Dec 1, 2023
@sarahzinger sarahzinger moved this from In Progress to Next in AWS Datasources Dec 1, 2023
@iwysiu iwysiu self-assigned this Apr 2, 2024
@iwysiu iwysiu moved this from Next to In Progress in AWS Datasources Apr 2, 2024
@iwysiu iwysiu changed the title Migrating to CustomVariableSupport breaks query template variables Migrate to CustomVariableSupport Apr 4, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in AWS Datasources Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants