Grafana App with Backend Plugin example
This template is a starting point for building an app plugin for Grafana. It includes a backend component.
What are Grafana app plugins?
App plugins can let you create a custom out-of-the-box monitoring experience by including custom pages, nested data sources, and panel plugins. A backend allows it to perform a variety of additional tasks, like handling incoming HTTP requests.
Get started
Frontend
-
Install dependencies
npm install
-
Build plugin in development mode or run in watch mode
npm run dev
-
Build plugin in production mode
npm run build
-
Run the tests (using Jest)
# Runs the tests and watches for changes
npm run test
# Exists after running all the tests
npm run lint:ci
-
Spin up a Grafana instance and run the plugin inside it (using Docker)
npm run server
-
Run the E2E tests
# Spin up a Grafana instance first that we tests against
npm run server
# Start the tests
npm run e2e
-
Run the linter
npm run lint
# or
npm run lint:fix
Backend
-
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:
mage -v
-
List all available Mage targets for additional commands:
mage -l
Learn more
Below you can find source code for existing app plugins and other related documentation.