This repository is deprecated and replaced by https://github.com/vertica/vertica-grafana-datasource.
vertica-grafana-datasource
This is a work-in-progress Grafana plugin to support the Vertica database.
It defines a new datsource that communicates with Vertica using the Vertica golang driver. [http://github.com/vertica/vertica-sql-go]. Due to this, we needed to implement both front and and back end components using the largely-undocumented backend framework.
- Set up a Go development environment with the appropriate GOROOT and GOPATH envrionment variables.
- Download Grafana itself and build it per their instructions. [http://github.com/grafana/grafana]
- Install npm [http://nodejs.org]
- Install dep [https://github.com/golang/dep]
- Start Grafana once by running the grafana-server binary you built in step 2.
- Create a symbolic link from the Grafana's plugin directory to this project's 'dist' directory thusly:
ln -s (this_dir)/dist (grafana_dir)/data/plugins/vertica-grafana-datasource
Note: If using Grafana 7.0.0, it now requires signed plugins and recommends updating plugins to use the new framework. The Vertica plugin is unsigned and currently doesn't use the new framework, so you will need to add the following configuration parameter to the /etc/grafana/grafana.ini file in the [plugins] section for it to load. Restart the Grafana server after adding this change. allow_loading_unsigned_plugins = vertica-grafana-datasource
Note: Grafana plans on depricating and eventually removing the ability to run unsigned plugins. Once they remove the ability this configuration parameter and the Vertica grafana datasource plugin will no longer work.
You can enable backend logging by setting two variables. On your Grafana server node...
export VERTICA_GRAFANA_LOG_FILE=(log file name)
export VERTICA_GRAFANA_LOG_LEVEL=[ DEBUG|INFO|ERROR|WARN|FATAL ] (default is INFO)
After that, you can simply watch the log file.
It is possible to run the grafana/grafana Docker image instead of a local grafana-server binary.
- Build the drivers source
dep ensure
- Building on Linux?
./build.sh
- Otherwise
cd backend GOOS=linux go build -o ../dist/vertica-grafana-datasource_linux_amd64 cd ..
- Start the grafana Docker image
docker-compose up -d
- Confirm that server has started
docker-compose logs
- Open web browser to localhost:30000/
- Cleanup the container, after testing
docker-compose down -v
- Make your code changes.
- Run './build.sh'
- Ctrl-C and re-run grafana-server
- Repeat until tired.