Plugins 〉Tutorials
Tutorials
Self-serve Tutorials App
Plugin where self-serve users' tutorials and walkthrough docs live.
Getting started
To have this project running locally, you will need to finish the following:
- Install all prerequisites.
- Have grafana-com running locally.
- Have all your local environment variables set up.
- Run the commands to start your server and docker.
1. Prerequisites
- Node
v.16.13.0
(We recommend using nvm to manage your node version) - Docker
- Docker Compose
latest
2. Setting up Grafana-com
Navigate to grafana-com to have the repository up and running locally.
3. Local set up
Install dependencies
npm install
Create your local stack token with access policies read/write, which will allow you to create more local tokens.
scripts/create-local-stack-token
You can confirm that the token exists by visiting the
access policies
tab here, and check that your token asaccesspolicies:read
,accesspolicies:write
, andaccesspolicies:delete
4. Start your plugin
Spin up a Grafana instance and run the plugin inside it (using Docker)
npm run server
Build plugin in development mode and run in watch mode
npm run dev
Login with user
admin
and passwordadmin
locally.
Useful commands
Run the linter
npm run lint
or
npm run lint:fix
Run prettier
Run spellcheck
npm run spellcheck
Testing
Run the tests (using Jest)
# Runs the tests and watches for changes, requires git init first npm run test
Exits after running all the tests
npm run test:ci
Run the E2E tests (using Cypress)
# Spins up a Grafana instance first that we tests against npm run server
Starts the tests
npm run e2e
Distributing your plugin
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.
Signing a plugin
Using Github actions release workflow
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.
- Please navigate to "settings > secrets > actions" within your repo to create secrets.
- Click "New repository secret"
- Name the secret "GRAFANA_API_KEY"
- Paste your Grafana Cloud API key in the Secret field
- Click "Add secret"
Push a version tag
To trigger the workflow we need to push a version tag to github. This can be achieved with the following steps:
- Run
npm version <major|minor|patch>
- Run
git push origin main --follow-tags
Learn more
Below you can find source code for existing app plugins and other related documentation.
Grafana Cloud Pro
- $25 / user / month and includes a free trial for new users
- Available with a Grafana Cloud Pro plan
- Access to 1 Enterprise plugin
- Fully managed service (not available to self-manage)
Grafana Cloud Advanced / Grafana Enterprise
- Available with a Grafana Cloud Advanced plan or Grafana Enterprise license
- Access to all Enterprise plugins
- Run fully managed or self-manage on your own infrastructure
Installing Tutorials on Grafana Cloud:
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
Installing plugins on a Grafana Cloud instance is a one-click install; same with updates. Cool, right?
Note that it could take up to 1 minute to see the plugin show up in your Grafana.
For more information, visit the docs on plugin installation.
Installing on a local Grafana:
For local instances, plugins are installed and updated via a simple CLI command. Plugins are not updated automatically, however you will be notified when updates are available right within your Grafana.
1. Install the Application
Use the grafana-cli tool to install Tutorials from the commandline:
grafana-cli plugins install
The plugin will be installed into your grafana plugins directory; the default is /var/lib/grafana/plugins. More information on the cli tool.
Alternatively, you can manually download the .zip file for your architecture below and unpack it into your grafana plugins directory.
Alternatively, you can manually download the .zip file and unpack it into your grafana plugins directory.
2. Enable it
Next, log into your Grafana instance. Navigate to the Plugins section, found in your Grafana main menu.
Click the Apps tabs in the Plugins section and select the newly installed app.
To enable the app, click the Config tab. Follow the instructions provided with the application and click Enable. The app and any new UI pages are now accessible from within the main menu, as designed by the app creator.
If dashboards have been included with the application, they will attempt to be automatically installed. To view the dashboards, re-import or delete individual dashboards, click the Dashboards tab within the app page.
Changelog
1.0.0 (Unreleased)
Initial release.