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

Service selection: Label selection UI #881

Conversation

gtk-grafana
Copy link
Contributor

@gtk-grafana gtk-grafana commented Nov 7, 2024

Third step of breaking #841 into more manageable chunks.

Adds combobox to index (service selection) so users can select multiple indexed labels without requiring navigation to breakdowns.

Note: When aggregated metrics feature is enabled and toggled, the new "combobox" and new filter buttons will not display in the UI as only a single include filter is currently supported for aggregated metrics.

TODO:

gtk-grafana and others added 30 commits November 4, 2024 07:35
…o gtk-grafana/service-selection-manual-panel-queries__combobox
…o gtk-grafana/service-selection-manual-panel-queries__combobox
@gtk-grafana gtk-grafana mentioned this pull request Nov 14, 2024
Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

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

Screen.Recording.2024-11-15.at.15.44.26.mov

The counter in the tabs doesn't seem to update accordingly.

Left a few nits, but overall it's working great!

src/Components/IndexScene/CustomVariableValueSelectors.tsx Outdated Show resolved Hide resolved
src/Components/IndexScene/LayoutScene.tsx Outdated Show resolved Hide resolved
src/Components/IndexScene/ShowLogsButtonScene.tsx Outdated Show resolved Hide resolved
src/Components/IndexScene/ShowLogsButtonScene.tsx Outdated Show resolved Hide resolved
Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

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

This state doesn't reset correctly.

Screen.Recording.2024-11-15.at.16.26.49.mov

@gtk-grafana
Copy link
Contributor Author

The counter in the tabs doesn't seem to update accordingly.

So it looks like allowing multiple includes in the UI conflicts with the tab counts.
For example I have an include filter in tab A, the volume query we run to get the number of panels will replace that value with .+ so we display all possible labels for the user to potentially filter on. If we run detected_labels with the same query, we'll get the correct counts for this and all tabs.
Then I switch to tab B, the label the volume query renders for the label in tab A is no longer .+, otherwise users could include a label that is mutually exclusive with the filter in tab A, dead-ending the user and returning no data for every future query. Now in the count for tab A, we'll show the number of include filters we've added, instead of the number of possible labels the user can select, so when on tab B, the label for tab A would be 1, but when on tab A the count would be n (the cardinality of that label before any filters are applied).

Since there's not an un-confusing way to let users know that the counts used in the tabs/dropdowns are only applicable before any filters are applied, we decided to remove the counts for now, which admittedly sucks, but is arguably better then confusing users with incorrect counts. :(

@gtk-grafana gtk-grafana requested a review from matyax November 18, 2024 20:50
Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

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

Looks and works perfectly, really nice work! Left a few minor comments around.

Just one thing that happened to me, that might happen to other people. When I clicked the "add to filters" buttons, I was confused for a minute expecting something to happen in the top section. Even with context about this feature, I was used to seeing filters being appended to the top, and the only change was the button becoming primary and enabled.

Teset.mov

For a follow up, can we consider adding the current filters as text, or at least as a tooltip in the button to make it more evident that you're about to show logs for the selected filters?

src/Components/IndexScene/CustomVariableValueSelectors.tsx Outdated Show resolved Hide resolved
src/Components/IndexScene/IndexScene.tsx Show resolved Hide resolved
src/Components/IndexScene/ShowLogsButtonScene.tsx Outdated Show resolved Hide resolved
}

return {
isIncluded: filterInSelectedFilters.operator === FilterOp.Equal,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can something be included and excluded at the same time? If not, I would recommend changing this to a boolean or enum.
Can also be included: boolean | null. null === no state, included true, excluded false.

@gtk-grafana
Copy link
Contributor Author

When I clicked the "add to filters" buttons, I was confused for a minute expecting something to happen in the top section. Even with context about this feature, I was used to seeing filters being appended to the top, and the only change was the button becoming primary and enabled.

@matyax yeah that's my bad, I had forgot to push my most recent commit which addressed exactly this, you've got aggregated metrics enabled, and we don't currently support more then a single label filter with agg metrics. We removed all those buttons when agg metrics is enabled.

@gtk-grafana gtk-grafana requested a review from matyax November 19, 2024 13:05
@matyax
Copy link
Contributor

matyax commented Nov 19, 2024

Oh, right. I'll disable it.

Copy link
Contributor

@matyax matyax left a comment

Choose a reason for hiding this comment

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

🚀

Copy link
Contributor

@svennergr svennergr left a comment

Choose a reason for hiding this comment

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

👍

…election-manual-panel-queries__combobox__service-selection-labels
@gtk-grafana gtk-grafana enabled auto-merge (squash) November 19, 2024 16:16
@gtk-grafana gtk-grafana merged commit ef1be7f into main Nov 19, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants