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

InfluxDB: Introduce custom variable support #87903

Merged
merged 3 commits into from
May 21, 2024

Conversation

itsmylife
Copy link
Contributor

What is this feature?

In general variable queries are just strings. But we need more flexibility to support various scenarios. To achieve that we need custom variable support. In this PR I am just implementing the custom variable support and not changing any logic.
This will help us to handle/deliver this #84120

Why do we need this feature?

More flexibility in the variable editor

Who is this feature for?

InfluxDB users

How to test

  • Have Influxql, Flux and SQL variables in legacy support.
  • Switch to this branch and test them again, try to run, refresh, update.
  • Introduce a new set of Influxql, Flux and SQL variables and save the dashboard.
  • Refresh, view and edit.
  • All actions must work.

Copy link
Contributor

@NWRichmond NWRichmond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I followed the testing steps and got the expected result:

demo.influxdb.variables.influxql.sql.flux.mov

DISCLAIMER: With Flux, I couldn't figure out how to get a Query-type variable to work, seemingly because Flux expects time bounds (|> range(start: v.timeRangeStart, stop: v.timeRangeStop)), and dashboard query variables don't appear to support that. So the Flux-derived panels instead use Custom-type variables.

In the process of reviewing this PR, I ran into a bug and created a new issue: #88008.

Nicely done!

@itsmylife itsmylife enabled auto-merge (squash) May 21, 2024 11:37
@itsmylife itsmylife disabled auto-merge May 21, 2024 11:37
@itsmylife itsmylife merged commit 9bdfb6e into main May 21, 2024
15 checks passed
@itsmylife itsmylife deleted the ismail/introduce-custom-variable-support branch May 21, 2024 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants