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

Scopes: Improve suggested dashboards listing #87964

Closed
wants to merge 2 commits into from

Conversation

bfmatei
Copy link
Contributor

@bfmatei bfmatei commented May 16, 2024

What is this feature?

This PR brings improvements to how and when the dashboards list is loaded.

Besides the improvements, this PR also fixes an issue where unselecting a scope would leave the suggested dashboards list intact.

Why do we need this feature?

So, the changes here are needed for various reasons. I'll take each change one by one and explain the rationale behind it.

  • only load suggested dashboards list when the scope selector is expanded
    • there is no need to load the dashboards list if we don't present it to the user
    • this will avoid a lot of API unnecessary calls as well as saving a lot of bandwidth
  • keep a map of loaded dashboards
    • because a dashboard can be suggested by multiple scopes, we only need to load its details once
    • this won't save a ton of API unnecessary calls but it will save a lot of bandwidth as we were loading the entire dashboard JSON every time
  • keep a map of dashboard IDs for each scope
    • because a scope can be toggled off and then on again, we will only load the dashboards for it once
    • this has the potential to avoid unnecessary API calls

Who is this feature for?

Which issue(s) does this PR fix?:

Special notes for your reviewer:

Also a video to illustrate all the changes:

Screen.Recording.2024-05-16.at.13.29.01.mov

Please check that:

  • It works as expected from a user's perspective.
  • If this is a pre-GA feature, it is behind a feature toggle.
  • The docs are updated, and if this is a notable improvement, it's added to our What's New doc.

@bfmatei bfmatei added area/dashboard no-changelog Skip including change in changelog/release notes team/grafana-dashboards Dashboards squad area/scopes scopes feature labels May 16, 2024
@bfmatei bfmatei self-assigned this May 16, 2024
@bfmatei bfmatei requested a review from a team as a code owner May 16, 2024 10:30
@bfmatei bfmatei requested review from axelavargas and removed request for a team May 16, 2024 10:30
@grafana-delivery-bot grafana-delivery-bot bot added this to the 11.1.x milestone May 16, 2024
@bfmatei
Copy link
Contributor Author

bfmatei commented Jun 5, 2024

Closing in favor of #88026

@bfmatei bfmatei closed this Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/dashboard area/frontend area/scopes scopes feature no-changelog Skip including change in changelog/release notes team/grafana-dashboards Dashboards squad
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant