Skip to content

Quick Start

leoswing edited this page Jul 13, 2026 · 1 revision

Quick Start

CompareQueries does not store metrics by itself. It executes queries against a real target datasource (for example Prometheus, Loki, Elasticsearch, SQL).

Prerequisites

  1. Install the plugin leoswing-comparequeries-datasource.
  2. Ensure your target datasource is already configured in Grafana.

Step 1. Create CompareQueries datasource

Go to:

Grafana -> Connections -> Data sources -> Add new data source -> search "compare"

Create datasource

Step 2. Configure datasource settings

Recommended default:

  • Authentication (Optional): No Authentication

Use Basic authentication only when backend or alerting requests fail authentication. In that case, configure:

  • Service Account token
  • Optional Grafana URL (only if auto-detection is incorrect)

Datasource settings

Step 3. Build dashboard query with Mixed datasource

  1. Create a dashboard panel.
  2. Set panel datasource to -- Mixed --.
  3. Add a query row and select CompareQueries as the row datasource.
  4. In CompareQueries editor, select Target Datasource.
  5. Build the target query with its native editor.
  6. Add one or more time-shift rows (Amount examples: 1d, 1w, 30m).
  7. Optional: enable Process TimeShift to align shifted series with the current time window.

Plugin usage

Notes

  • Empty Amount means no shift (base series).
  • For Grafana 13+ and all new dashboards, use the Target Datasource flow above.
  • Legacy RefId workflow is only for existing dashboards on older Grafana versions.

Clone this wiki locally