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

feat(ui): add flux query builder #5852

Merged
merged 133 commits into from
Feb 9, 2022
Merged

feat(ui): add flux query builder #5852

merged 133 commits into from
Feb 9, 2022

Conversation

sranka
Copy link
Contributor

@sranka sranka commented Feb 3, 2022

This PR adds a new Flux Query Builder that lets users build a flux query using available buckets, available tag names, and tag values.

image

Its functionality is almost the same as in the v2 UI. It is technically not a backport, the situation in chronograf is a bit different to v2 UI in many aspects (more supported databases, different UI technologies, single and different flux editor, different state management ...)

The key features of the new query builder are (comparing to the existing chronograf flux Schema explorer):

  • it always builds a complete flux query/script
  • it is always scoped to a selected time range
  • offers new tag keys and values based on already selected tag keys and tag values
  • scales well even with big tag name/value spaces, the background queries are limited to 200; the user can search for key names/values.

The existing Query Wizard dialog was removed, its functionality was a simple subset of the Flux Query Builder.

@timhallinflux
Copy link
Contributor

we ran into a couple of issues recently re: only fetching the first 200 tags, fields, etc. Essentially, this leads to a bad user experience for a couple of reasons: 1) there is no indication that its a partial result set and 2) there isn't a way to ask for more than 200 results. I would like to avoid repeating this experience.

@timhallinflux
Copy link
Contributor

Script Editor > Query Editor

@sranka
Copy link
Contributor Author

sranka commented Feb 5, 2022

we ran into a couple of issues recently re: only fetching the first 200 tags, fields, etc. Essentially, this leads to a bad user experience for a couple of reasons: 1) there is no indication that its a partial result set and 2) there isn't a way to ask for more than 200 results. I would like to avoid repeating this experience.

@timhallinflux I see that a v2 UI solution was added 2 weeks ago. The limit is increased to 500 with a feature flag (influxdata/ui#3703). I can extend the limit herein quickly to 500 to follow the approach of v2 UI. I would rather create a new PR on top of the existing one to implement a functionality that would let the user load more data. WDYT?

@sranka sranka marked this pull request as ready for review February 5, 2022 09:52
@timhallinflux
Copy link
Contributor

I believe that is a short term fix. Something else will be done to address this longer term.

But it seems like the idea is to essentially keep these implementations more closely aligned?

As opposed to just making some changes to how the schema is fetched (using the new Flux schema package?) and keeping the original design that Chronograf provided? In some ways the tree view works better than the filter panels...

@sranka sranka closed this Feb 5, 2022
@sranka
Copy link
Contributor Author

sranka commented Feb 5, 2022

But it seems like the idea is to essentially keep these implementations more closely aligned?

We should keep them close from the functional perspective, but they already have to diverge in many aspects from the implementation POV.

As opposed to just making some changes to how the schema is fetched (using the new Flux schema package?) and keeping the original design that Chronograf provided? In some ways the tree view works better than the filter panels...

The new Flux's schema package (at the moment) would not bring any improvement regarding the stability and scalability of the implementation. There is no extra optimization, it executes the same queries as the current chronograf implementation does. Chronograf implementation intentionally does not rely upon flux's schema package in order to support older 1.x and 2.x databases.

I also believe that the existing Schema tree is vital and also traditional in many use cases, but it does not scale well with huge data set by design ... unlike the filter panels that cumulatively restrict the data set to choose from. This PR is a solution to #5833 and https://github.com/influxdata/feature-requests/issues/329, these are use-cases that would not be possible with the existing Schema tree view.

There are still some changes that would improve UX of the existing Schema tree, restricting the data set to a user-selected window (not 30days OOTB) will help the most. It is reported in #5849, it will be the next improvement to implement in 1.9.4 . It won't be a big implementation challenge.

@timhallinflux
Copy link
Contributor

some visual clue that the schema tree is controlled by the time range selector...would be helpful. 2.x starts with the last hour ...and if the initial date loaded is beyond that, it is confusing as the user doesn't realize they need to adjust the time range in order to see it.

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.

Flux query editor/wizard not working on bigger or high cardinality influx database
3 participants