From 2ed9b15ce83a16d769561fe4d0eff33046f4a6fb Mon Sep 17 00:00:00 2001 From: Philipp Paulweber Date: Thu, 8 Feb 2024 20:55:22 +0100 Subject: [PATCH 1/2] Dependency: updated NPM modules --- package-lock.json | 4 ---- package.json | 4 ---- 2 files changed, 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index e0c818b..c23c9e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,17 +9,13 @@ "version": "0.2.0", "license": "Apache-2.0", "dependencies": { - "@cypress/request": ">=3.0.0", "@emotion/css": "11.10.6", "@grafana/data": "10.0.3", "@grafana/runtime": "10.0.3", "@grafana/schema": "10.0.3", "@grafana/ui": "10.0.3", - "log4js": ">=6.4.0", - "nanoid": ">=3.1.31", "react": "18.2.0", "react-dom": "18.2.0", - "tough-cookie": ">=4.1.3", "tslib": "2.5.3", "underscore": ">=1.12.1" }, diff --git a/package.json b/package.json index f984188..fd07a6e 100644 --- a/package.json +++ b/package.json @@ -22,17 +22,13 @@ "node": ">=20" }, "dependencies": { - "@cypress/request": ">=3.0.0", "@emotion/css": "11.10.6", "@grafana/data": "10.0.3", "@grafana/runtime": "10.0.3", "@grafana/schema": "10.0.3", "@grafana/ui": "10.0.3", - "log4js": ">=6.4.0", - "nanoid": ">=3.1.31", "react": "18.2.0", "react-dom": "18.2.0", - "tough-cookie": ">=4.1.3", "tslib": "2.5.3", "underscore": ">=1.12.1" }, From b2f9ecf3d1108a9805d41aeb3356bd5ea6dc25c7 Mon Sep 17 00:00:00 2001 From: Philipp Paulweber Date: Thu, 8 Feb 2024 20:56:15 +0100 Subject: [PATCH 2/2] Release: 0.3.0 --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- src/README.md | 12 ++++++++++-- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1e4f8cc..b14253e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.0 + +Provided dashboard variable-based query support. + ## 0.2.0 Provided new `groupBy` functionality in `metric` query mode in order to perform data grouping for plain `metric` values as well as `rate` based functions. diff --git a/package-lock.json b/package-lock.json index c23c9e0..9c61259 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "surrealdb", - "version": "0.2.0", + "version": "0.3.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "surrealdb", - "version": "0.2.0", + "version": "0.3.0", "license": "Apache-2.0", "dependencies": { "@emotion/css": "11.10.6", diff --git a/package.json b/package.json index fd07a6e..2d2377d 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "surrealdb", "author": "fiskaly", "license": "Apache-2.0", - "version": "0.2.0", + "version": "0.3.0", "description": "Grafana Data Source Plugin for SurrealDB", "scripts": { "build": "webpack -c ./.config/webpack/webpack.config.ts --env production", diff --git a/src/README.md b/src/README.md index 2a917f8..2e01547 100644 --- a/src/README.md +++ b/src/README.md @@ -25,7 +25,7 @@ Since the plugin is used to query the contents of one or multiple SurrealDB [tab The plugin can be installed through the user interface in the Grafana service itself or by using the command-line utility via: ``` -$ grafana-cli plugins install fiskaly-surrealdb-datasource +$ grafana cli plugins install fiskaly-surrealdb-datasource ``` If the Grafana service was setup in a containerized context via e.g. `docker-compose` or started locally on a machine the plugin can be installed automatically for the Grafana instance during start-up by setting the following environment variable: @@ -72,6 +72,14 @@ Furthermore, based on the `Data` column there is an option to perform data group ![query](https://github.com/fiskaly/grafana.surrealdb/assets/6830431/77f47494-1815-48bc-8e40-ff43822bc68d) +## Variable Query + +This plugin provides `raw` query support for dashboard variables. +The values of the first column in the query response are used for the result set of values for the defined variable in the dashboard. + +--- + +![variable-query](https://github.com/fiskaly/grafana.surrealdb/assets/6830431/ec84cade-49ac-49d4-9479-323429641ee3) ## Design @@ -81,7 +89,7 @@ The frontend is written in TypeScript and provides two major components: (2) a `QueryEditor` to write queries in SurrealDB Query Language ([SurrealQL](https://docs.surrealdb.com/docs/surrealql/overview/)), configure the query mode, and interact with the backend part of the data source plugin. The backend is written in Golang and provides a low-level connection through the SurrealDB [WebSocket](https://docs.surrealdb.com/docs/integration/websocket) interface. -After the successful connection and [signin](https://docs.surrealdb.com/docs/integration/websocket/#signin) operation, all queries send from the frontend part to the backend part are directly executed through the WebSocket connection using the [custom query](https://docs.surrealdb.com/docs/integration/websocket#query) operation. +After the successful connection and [signin](https://docs.surrealdb.com/docs/integration/websocket/#signin) operation, all queries sent from the frontend part to the backend part are directly executed through the WebSocket connection using the [custom query](https://docs.surrealdb.com/docs/integration/websocket#query) operation. Since SurrealDB as well as Grafana support [variables](https://grafana.com/docs/grafana/latest/dashboards/variables/) the plugin supports and performs the following variable resolving steps: (1) in the frontend part are all Grafana scope provided variables replaced; and