Development

Development setup

This data source plugin consists of both frontend and backend components.

Front-end Development

Node version v12.x is recommended. If you’re new to the Node.js ecosystem, Node Version Manager is a good place to start for managing different Node.js installations and environments.

grafana-toolkit is used to develop the plugin. Please refer grafana-toolkit documentation for more information.

  1. Begin by installing Yarn (https://yarnpkg.com/)

    npm install -g yarn
    
  2. Install dependencies

    yarn install
    
  3. Build plugin in development mode or run in watch mode

    yarn dev
    

    or

    yarn watch
    
  4. Build plugin in production mode

    yarn build
    

Back-end Development

If the Mage build tool is not already installed, you may install it using the installation instructions on the Mage homepage

  1. Update Grafana plugin SDK for Go dependency to the latest minor version:

    go get -u github.com/grafana/grafana-plugin-sdk-go
    
  2. Build backend plugin binaries for Linux, Windows and Darwin:

    mage -v
    
  3. List all available Mage targets for additional commands:

    mage -l
    

Build documentation

This documentation is build by Sphinx. Follow below steps to build documentation.

python -m venv env
source env/bin/activate
pip install sphinx myst-parser sphinx_rtd_theme
make html