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

DashboardDataSourceBehaviour: Handle loading library panel #86980

Merged
merged 4 commits into from Apr 29, 2024

Conversation

dprokop
Copy link
Member

@dprokop dprokop commented Apr 26, 2024

Fixes #86966

https://raintank-corp.slack.com/archives/C03MCTKAJA0/p1714062157912579

The problem was that LibraryVizPanel loads source panel asynchroniously and can only set internal VizPanel's SceneQueryRunner when the panel is resolved. The behavior did not account for that throwing early as it couldn't find the corresponding query runner that indicates readiness for dashboard query execution.

@dprokop dprokop added type/bug no-changelog Skip including change in changelog/release notes backport v11.0.x Mark PR for automatic backport to v11.0.x labels Apr 26, 2024
@dprokop dprokop added this to the 11.1.x milestone Apr 26, 2024
@dprokop dprokop self-assigned this Apr 26, 2024
@dprokop dprokop requested a review from a team as a code owner April 26, 2024 10:58
@dprokop dprokop requested review from ivanortegaalba and Sergej-Vlasov and removed request for a team April 26, 2024 10:58
Copy link
Contributor

This PR must be merged before a backport PR will be created.

1 similar comment
Copy link
Contributor

This PR must be merged before a backport PR will be created.

@@ -83,7 +83,7 @@ export class LibraryVizPanel extends SceneObjectBase<LibraryVizPanelState> {

private async loadLibraryPanelFromPanelModel() {
let vizPanel = this.state.panel!;

await new Promise((f) => setTimeout(f, 1000));
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
await new Promise((f) => setTimeout(f, 1000));

Was here to simulate slow loading time

Copy link
Member

@axelavargas axelavargas left a comment

Choose a reason for hiding this comment

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

🙌🏾 great job, @dprokop , the code looks great, I also gave a quick test locally, works as expected.

@dprokop dprokop merged commit 67968df into main Apr 29, 2024
14 checks passed
@dprokop dprokop deleted the fix-slow-library-pannel branch April 29, 2024 07:49
grafana-delivery-bot bot pushed a commit that referenced this pull request Apr 29, 2024
* DashboardDataSourceBehaviour: Handle loading library panel

* Remove timeout

* FIx test

(cherry picked from commit 67968df)
dprokop added a commit that referenced this pull request Apr 29, 2024
…87023)

DashboardDataSourceBehaviour: Handle loading library panel (#86980)

* DashboardDataSourceBehaviour: Handle loading library panel

* Remove timeout

* FIx test

(cherry picked from commit 67968df)

Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/frontend backport v11.0.x Mark PR for automatic backport to v11.0.x no-changelog Skip including change in changelog/release notes type/bug
Projects
Status: 🚀 Done
Development

Successfully merging this pull request may close these issues.

DashboardScene: Runtime error Could not find SceneQueryRunner for panel in a specific dashboard
2 participants