Plugins 〉CompareQueries
CompareQueries
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
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.
Step 3. Create a Visualization and using this plugin as the mixed data source.
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)
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
.h4 . .mb-0 }
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Grafana Cloud Free
- Free tier: Limited to 3 users
- Paid plans: $55 / user / month above included usage
- Access to all Enterprise Plugins
- Fully managed service (not available to self-manage)
Self-hosted Grafana Enterprise
- Access to all Enterprise plugins
- All Grafana Enterprise features
- Self-manage on your own infrastructure
Installing CompareQueries on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Data Source
Use the grafana-cli tool to install CompareQueries from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Configure the Data Source
Accessed from the Grafana main menu, newly installed data sources can be added immediately within the Data Sources section.
Next, click the Add data source button in the upper right. The data source will be available for selection in the Type select box.
To see a list of installed data sources, click the Plugins item in the main menu. Both core data sources and installed data sources will appear.
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()
andgetTemplateSrv()
import from'@grafana/runtime'
to fetch dataSourceSrv and templateSrv - Remove
MutableField
和ArrayVector
from datasource, and refactor withField
andArray
support.
Bug fixes
- Solve data point undefined issue when no database is selected.