This template is a starting point for building a panel plugin for Grafana.
Panel plugins allow you to add new types of visualizations to your dashboard, such as maps, clocks, pie charts, lists, and more.
Use panel plugins when you want to do things like visualize data returned by data source queries, navigate between dashboards, or control external systems (such as smart home devices).
Install dependencies
yarn install
Build plugin in development mode and run in watch mode
yarn run dev
Build plugin in production mode
yarn run build
Run the tests (using Jest)
# Runs the tests and watches for changes, requires git init first
yarn run test
# Exits after running all the tests
yarn run test:ci
Spin up a Grafana instance and run the plugin inside it (using Docker)
yarn run server
Run the E2E tests (using Cypress)
# Spins up a Grafana instance first that we tests against
yarn run server
# Starts the tests
yarn run e2e
Run the linter
yarn run lint
# or
yarn run lint:fix
When distributing a Grafana plugin either within the community or privately the plugin must be signed so the Grafana application can verify its authenticity. This can be done with the @grafana/sign-plugin
package.
Note: It's not necessary to sign a plugin during development. The docker development environment that is scaffolded with @grafana/create-plugin
caters for running the plugin without a signature.
Before signing a plugin please read the Grafana plugin publishing and signing criteria documentation carefully.
@grafana/create-plugin
has added the necessary commands and workflows to make signing and distributing a plugin via the grafana plugins catalog as straightforward as possible.
Before signing a plugin for the first time please consult the Grafana plugin signature levels documentation to understand the differences between the types of signature level.
plugin.json
file inside your plugin directory. For example, if your account slug is acmecorp
, you need to prefix the plugin ID with acmecorp-
.PluginPublisher
role.If the plugin is using the github actions supplied with @grafana/create-plugin
signing a plugin is included out of the box. The release workflow can prepare everything to make submitting your plugin to Grafana as easy as possible. Before being able to sign the plugin however a secret needs adding to the Github repository.
To trigger the workflow we need to push a version tag to github. This can be achieved with the following steps:
npm version <major|minor|patch>
git push origin main --follow-tags
Below you can find source code for existing app plugins and other related documentation.