Allows Neo4j to be used as a DataSource for Grafana
Starts preprovisioned Grafana and Neo4j
sudo docker-compose up
Optional: Use Docker for building with yarn
sudo docker run --rm -w /app -it -v $(pwd):/app node:14.17.3-alpine ash
Change into plugin directory
cd neo4j-datasource-plugin
Install dependencies
yarn install
Build Plugin in development mode
yarn dev
Build Plugin in watch mode (development mode with auto build on change) You need to hit refresh in browser to load the changes!
yarn watch
Build plugin in production mode
yarn build
Execute Prettier
yarn prettier --write .
NOTE: Depending on your version of go you might need
go get -u
instead ofgo install
.
Optional: Use Docker for building with go
sudo docker run --rm -w /app -it -v $(pwd):/app golang:1.16 bash
go install github.com/magefile/mage
-
Update Grafana plugin SDK for Go dependency to the latest minor version:
go install github.com/grafana/grafana-plugin-sdk-go go mod tidy
-
Build with go:
go install ./... go build ./...
-
Build backend plugin binaries for Linux, Windows and Darwin:
mage -v
-
List all available Mage targets for additional commands:
mage -l
-
Run all tests & coverage:
Important: Start Docker-Compose environment first!
sudo docker-compose -f docker-compose.dev.yaml up
mage coverage
-
Run tests which are independet of Docker-Compose environment
mage coverageShort
Starts preprovisioned Grafana and Neo4J for development
sudo docker-compose -f docker-compose.dev.yaml up
Grafana: http://localhost:3000
Neo4J: http://localhost:7474
Grafana is started by docker-compose in development mode therefore no restart of grafana is required when source code changed.
Nodes
Match(m:Movie) return m
Tabledata
Match(m:Movie) return m.title, m.tagline
Timeseriesdata
return datetime() - duration({minutes: 1}) as Time, 99 as Test
UNION ALL
return datetime() - duration({minutes: 2}) as Time, 85 as Test
UNION ALL
return datetime() - duration({minutes: 3}) as Time, 86 as Test
UNION ALL
return datetime() - duration({minutes: 4}) as Time, 100 as Test
UNION ALL
return datetime() - duration({minutes: 5}) as Time, 32 as Test
Sign plugin as private
cd neo4j-datasource-plugin
export GRAFANA_API_KEY=<GRAFANA_API_KEY>
yarn sign --rootUrls http://localhost:3000/
Sign plugin as community
cd neo4j-datasource-plugin
export GRAFANA_API_KEY=<GRAFANA_API_KEY>
yarn sign
- Build a data source plugin tutorial
- Build a data source backend plugin tutorial
- Example data source backend plugin
- Grafana documentation
- Grafana Tutorials - Grafana Tutorials are step-by-step guides that help you make the most of Grafana
- Grafana UI Library - UI components to help you build interfaces using Grafana Design System
- Grafana Toolkit
- Grafana plugin SDK for Go
- Roadmap: Grafana plugins platform