Version: 1.0.0
This sample demonstrates how to build a Grafana data source plugin that runs queries against the Sequential Data Store (SDS) of the Edge Data Store (EDS). The sample performs normal "Get Values" calls against a specified stream in SDS, using the time range of the Grafana dashboard.
- Grafana 8.3+
- Web Browser with JavaScript enabled
- NodeJS
- Git
- If building the plugin, a Linux OS or WSL for Windows is required. Refer to grafana's troubleshooting documentation for more information.
- The browser must be running locally on a device running the Edge Data Store
If you plan to run this sample plugin on an existing Grafana server, the recommended sections are:
- Building and Deploying the Sample Plugin on a Grafana Server
- Configuring the Sample Plugin in Grafana
If you wish to deploy the sample plugin with a docker container also containing Grafana, then the recommended sections are:
If you are a developer that wants to customize the plugin or add functionality to it, then the recommend sections are:
- Copy this folder to your Grafana server's plugins directory, like
.../grafana/data/plugins
- (Optional) If using other plugins, rename the folder to
aveva-eds-datasource
- Open a command prompt inside that folder
- Install dependencies, using
npm install
- Build the plugin, using
npm run build
(ornpm run dev
for browser debugging) - Open the Grafana configuration and set the parameter
allow_loading_unsigned_plugins
equal toaveva-eds-datasource
or to the name of the folder set in step 2 (see Grafana docs) - Restart the Grafana server to load the new plugin
- Open a command prompt inside this folder
- Build the container using
docker build -t grafana-eds .
Note: The dockerfile being built contains an ENV statement that creates an environment variable that overrides an option in the grafana config. In this case, theallow_loading_unsigned_plugins
option is being overridden to allow the unsigned plugin in this sample to be used. - Run the container using
docker run -d --name=grafana-eds -p 3000:3000 grafana-eds
- Navigate to localhost:3000 to configure data sources and view data
- Add a new Grafana datasource using the sample (see Grafana docs)
- Enter the port that EDS is running on
- Open a new or existing Grafana dashboard, and choose the
AVEVA Edge Data Store (SAMPLE)
as the data source - Enter your Stream, and data will populate into the dashboard from the stream for the dashboard's time range
- Open a command prompt inside this folder
- Install dependencies, using
npm install
- Build the plugin for development, using
npm run dev
- In a new terminal window, update Grafana plugin SDK for Go dependency to the latest minor version, using
go get -u github.com/grafana/grafana-plugin-sdk-go
andgo mod tidy
- Build backend plugin binaries for Linux
mage -v build:Linux
- Start grafana by running
docker-compose up --build
- Open Grafana, by default
http://localhost:3000/
- Open a command prompt inside this folder
- Install dependencies, using
npm install
- Run the tests, using
npm run test
- Open a command prompt inside this folder
- Install dependencies, using
go mod tidy
- Run the tests, using
go test
For the main ADH page ReadMe
For the main samples page ReadMe