Developing Redis Data Source¶
👁 Go Report Card
👁 CI
👁 codecov
👁 Language grade: JavaScript
Developing Redis Data Source involves setting up the development environment (which can be either Linux-based or macOS-based), building and running tests.
Install Grafana¶
Grafana can be started in Docker or installed locally:
-
Follow Installation instructions to install and start Grafana
-
Open Grafana UI in web-browser
http://X.X.X.X:3000
Clone repository¶
gitclonehttps://github.com/RedisGrafana/grafana-redis-datasource.git
Build¶
Frontend¶
-
Install the latest version of Node.js using Node Version Manager or download binaries
-
Install
yarnglobally
npminstallyarn-g
- Install dependencies
yarninstall
- Build frontend components
yarnbuild
Backend¶
- Install Golang for your platform
yuminstallgo
- Install Grafana plugin SDK for Go dependency
goget-ugithub.com/grafana/grafana-plugin-sdk-go
- Install Mage (make-like build tool using Go)
gitclonehttps://github.com/magefile/mage
cdmage
gorunbootstrap.go
- Build backend binaries for Linux, Windows and MacOS for supported platforms
yarnbuild:backend
Start Grafana¶
Prerequisite
Docker Compose should be pre-installed following documentation.
yarnstart:dev
Move distribution to Grafana's plugins/ folder
mvdist//var/lib/grafana/plugins/redis-datasource
Add redis-datasource to allowed unsigned plugins
vi/etc/grafana/grafana.ini
[plugins]
;enable_alpha = false
;app_tls_skip_verify_insecure = false
# Enter a comma-separated list of plugin identifiers to identify plugins that are allowed to be loaded even if they lack a valid signature.
allow_loading_unsigned_plugins=redis-datasource
Restart Grafana and verify that plugin registered
tail-100/var/log/grafana/grafana.log
t=2020-07-01T06:03:38+0000 lvl=info msg="Starting plugin search" logger=plugins
t=2020-07-01T06:03:38+0000 lvl=warn msg="Running an unsigned backend plugin" logger=plugins pluginID=redis-datasource pluginDir=/var/lib/grafana/plugins/redis-datasource
t=2020-07-01T06:03:38+0000 lvl=info msg="Registering plugin" logger=plugins name=redis-datasource
t=2020-07-01T06:03:38+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
Configuration¶
The Redis Data Source Configuration page explains how to connect data source to Redis database.
Contact Us¶
If you have questions, enhancement ideas or running into issues, please open an issue.
