-
Notifications
You must be signed in to change notification settings - Fork 16
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: Replacing datasource resource calls with query runners #651
Service selection: Replacing datasource resource calls with query runners #651
Conversation
@gtk-grafana I don't think you need the
protected _variableDependency = new VariableDependencyConfig(this, {
variableNames: [VAR_DATASOURCE],
onReferencedVariableValueChanged: this.onReferencedVariableValueChanged.bind(this),
});
private onReferencedVariableValueChanged(variable: SceneVariable) {
if (variable.state.name === VAR_DATASOURCE) {
if (this.state.$data instanceof SceneQueryRunner) {
this.state.$data.runQueries();
}
return;
}
} |
Thanks Sven, should be updated now, and I also added an e2e test to ensure that changing the datasource re-triggers the volume query |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Love the tests! Left a few nits, but great stuff.
…y on loading state
Thanks for the feedback, everything should be updated now! Quick bug fix: I noticed that when running queries against loki-ops I was still getting the cancelled queries I worked so hard to fix, found out it was the loading state was gating the render of the body, which was cleaning up the existing query runners. Dunno why it wasn't happening with the gdev-loki datasource, but I just changed the render method to show the body when we have services, so we don't clean up all those query runners for panels for a specific service that will probably be in the next request as well. |
…calls-query-runner-poc
Replacing direct datasource resource calls with runtime datasource to provide sceneQueryProvider.
This will prevent duplicate calls from being made until the user changes a variable or time range that the query depends on.
This PR refactors the service selection scene to call the volume API using a scene query provider. On routing back to the service route, the volume API will not be re-called unless 10% of the time range has elapsed since the time range was activated (for relative queries).