In some cases, you might want to:
- modify some core Grafana components or
- test some hypothesis on the plugin that require modifying the platform code,
- etc.
This section describes how you can set up your local development environment to work both on the plugin and on Grafana code bases.
Note
This document provides instructions for Unix environments. Any contribution to help covering Windows environments is more than welcome :)
-
Ensure that your local version of the plugin is properly set up
-
Check out a local copy of Grafana:
git clone https://github.com/grafana/grafana
-
Setup your local Grafana development environment by following Grafana's Developer's guide.
In a terminal:
# path to Grafana's local copy
GRAFANA_DIR=~/path/to/grafana
# path to the plugin's local copy
PYROSCOPE_APP_DIR=~/path/to/the/pyroscope-app-plugin
By default, Grafana will search for its plugins in this directory:
$GRAFANA_DIR/data/plugins
.
As it may not exist, let's create it:
mkdir -pv $GRAFANA_DIR/data/plugins
Then we provide a plugin's configuration file:
cp $PYROSCOPE_APP_DIR/samples/provisioning-remote/plugins/app.yaml $GRAFANA_DIR/conf/provisioning/plugins/pyroscope-app.yaml
And finally we create a symbolic link named pyroscope-app
to the dist
folder of the plugin:
cd $GRAFANA_DIR/data/plugins
ln -s $PYROSCOPE_APP_DIR/dist pyrosope-app
Start Grafana:
cd $GRAFANA_DIR
yarn start
In a different terminal tab, start the plugin:
cd $PYROSCOPE_APP_DIR
yarn dev
Then visit http://localhost:3000