Allows Neo4j to be used as a DataSource for Grafana
Starts preprovisioned Grafana and Neo4j
sudo docker-compose up
Grafana Ui - Component library
Optional: Use Docker for building with yarn
sudo docker run --rm -w /app -it -v $(pwd):/app node:18.17.0-alpine ash
Change into plugin directory
cd neo4j-datasource-plugin
Install dependencies
npm install
Build Plugin in development mode (incl. auto build on change)
npm run dev
Build plugin in production mode
yanpm run 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.20 bash
cd neo4j-datasource-plugin
go install github.com/magefile/mage
-
Update Grafana plugin SDK for Go dependency to the latest minor version:
go get -u github.com/grafana/grafana-plugin-sdk-go go mod tidy
-
Build backend plugin binaries for Linux, Windows and Darwin:
export GOFLAGS=-buildvcs=false mage -v
-
List all available Mage targets for additional commands:
mage -l
-
Build with go:
export GOFLAGS=-buildvcs=false go install ./... go build ./...
-
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 frontend 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
cd neo4j-datasource-plugin
export GRAFANA_API_KEY=<GRAFANA_API_KEY>
npx @grafana/sign-plugin@latest --rootUrls http://localhost:3000/
cd neo4j-datasource-plugin
export GRAFANA_API_KEY=<GRAFANA_API_KEY>
npx @grafana/sign-plugin@latest
- Grafana Plugin development - Getting Started
- Create a grafana plugin
- Update Create Plugin Tool
- 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