-
Notifications
You must be signed in to change notification settings - Fork 1
Quick‐Start
leoswing edited this page May 25, 2026
·
1 revision
This guide helps you create your first comparison chart with CompareQueries in Grafana.
- Grafana installed and running
- CompareQueries plugin installed:
- Plugin ID:
leoswing-comparequeries-datasource
- Plugin ID:
- A target datasource already available in Grafana (for example Prometheus, Loki, Elasticsearch, MySQL, PostgreSQL)
- Open Connections -> Data sources.
- Click Add data source.
- Search for CompareQueries.
- Save and test.
Default setting is usually enough:
-
Authentication:
No Authentication
Only switch to Basic authentication when backend or alerting requests fail due to auth issues:
- Set Service Account Token
- Set Grafana URL only if auto-detection is incorrect
- Open or create a dashboard.
- Add a new panel.
- Set panel datasource to
-- Mixed --. - Add a query row and choose CompareQueries as the row datasource.
Inside CompareQueries query editor:
- Choose Target Datasource.
- Build your target query using the native editor.
- Add one or more Time-shift rows:
-
1dfor yesterday -
1wfor last week -
30mfor 30 minutes earlier
-
- (Optional) Enable Process TimeShift if you want shifted series aligned to the current time window.
Use alias fields to make legends easy to read, for example:
currentyesterdaylast_week
- Save the panel and dashboard.
- Confirm multiple shifted series are displayed in the same chart.
- Grafana 13+: Use the Target Datasource flow (recommended and required for new dashboards).
- Grafana 11/12 existing dashboards: Legacy RefId workflow can still work, but new dashboards should use Target Datasource flow.
- For alerting setup, see the Alerting page.
- For migration from legacy RefId queries, see the Migration Guide page.
- For local development and debugging, see Developer Guide.