Plugins 〉CompareQueries


Developer

leoswing


Sign up to receive occasional product news and updates:



Data Source
community

CompareQueries

  • Overview
  • Installation
  • Change log
  • Related content

CodeQL

Overview

This data source plugin enables data comparison capabilities by supporting queries from multiple data sources. It allows you to use custom time shifts to display data from different time ranges within a single graph.

Key features:

  • Compatible with Grafana 11
  • Resolves issues with undefined data points
  • Introduces support for timeShift aliases

Plugin-snapshot

Quick start

Step 1. Add a data source with what you want, such as Elasticsearch.

Step 2. Create a data source with type CompareQueries. Grafana --> Connections --> Data sources --> Add new data source, then type 'compare' to use CompareQueries plugin.

Screenshot-create-db

Step 3. Create a Visualization and using this plugin as the mixed data source.

Screenshot-mixed-db

Step 4. Create a basic query using your database, such as Elasticsearch.

Step 5. Create a comparison query with this plugin, to create multi-line time series, the query requires at least 2 fields in the following order:

  • field Query: Query field which refer to the basic query name
  • field Amount: Amount field with time range, time shift supports:s(second), m(minute), h(hour), d(day), w(week), M(month), y(year)

Screenshot-usage-comparequeries

Installing CompareQueries on Grafana Cloud:

For more information, visit the docs on plugin installation.

2.0.0 (2024-06-25)

Breaking change

  • Refactor the plugin id with leoswing-comparequeries-datasource, and signed with public signature level in Grafana.
  • Repo name refactor to comparequeries-datasource-rc
  • Package.json name refactor to leoswing-comparequeries-datasource
  • Release workflow publish the zip name to formate ${{ env.NAME }}-${{ env.TAG }}.zip

1.2.0 (2024-06-24)

Features and enhancements

  • Upgrade QueryEditor data binding logics from query property

Bug fixes

  • Fix QueryEditor data model timeShifts lost when refresh issue #2

1.1.0 (2024-06-20)

Features and enhancements

  • Suit with Grafana 11, remove filterQuery method as it should migrate, see PR

1.0.0 (2024-06-18)

Restructure repo with React based framework support.

Features and enhancements

  • Restructure codebase with React-based, which could refer to the tutorial
  • Add alias name as displayName support.
  • QueryEditor with React jsx and models supprt.
  • Use getDataSourceSrv() and getTemplateSrv() import from '@grafana/runtime' to fetch dataSourceSrv and templateSrv
  • Remove MutableFieldArrayVector from datasource, and refactor with Field and Array support.

Bug fixes

  • Solve data point undefined issue when no database is selected.