grafana / explore-logs

Repo for the Loki log exploration app
GNU Affero General Public License v3.0
308 stars 14 forks source link

ServiceSelectionScene: Manual query runners #868

Closed gtk-grafana closed 2 weeks ago

gtk-grafana commented 2 weeks ago

First step of breaking https://github.com/grafana/explore-logs/pull/841 into manageable chunks.

This PR does two things:

  1. Converts the service selection scene query runners to "manual" runQueriesMode, and executes queries on activation, datasource, and time range updates.
  2. Tears down the Volume query runner when updating the aggregated metric toggle. This is required to prevent duplicate queries from being run as the entire body is rebuilt, triggering activation for the existing panels.

Why: Preparing for https://github.com/grafana/explore-logs/pull/841, we will need to execute panel queries manually to avoid duplicate queries, as we'll be adding the ability for users to change the label filters, which is used in the logs panel and volume queries, since the volume queries trigger the panel queries, and changing the labels triggers volume and panel queries as that variable is interpolated in both, we need to be able to skip executing the panel queries every time the labels change.

When: Slated for merge to main 1.0.4 after 1.0.3 release which should go out early this week.