Skip to content

Latest commit

 

History

History
73 lines (43 loc) · 2.89 KB

developer-guide.md

File metadata and controls

73 lines (43 loc) · 2.89 KB

Developer Guide

This is a very basic guide on how to set up your local environment, make the desired changes and see the result with a fresh Grafana Installation.

Getting Started

Clone this repository to your local environment. The frontend code lives in the src folder, alongside the plugin.json file. See this Grafana tutorial to understand better how a plugin is structured and installed.

Backend code, written in Go, is located in the pkg folder.

Requirements

For this standard execution, you will need the following tools:

Running the development version

Compiling the Backend

If you have made any changes to any go files, you can use mage to recompile the plugin.

mage build:linux && mage reloadPlugin

Compiling the Frontend

After you made the desired changes, you can build and test the new version of the plugin using yarn:

yarn test # run all test cases
yarn dev # builds and puts the output at ./dist

Alternatively, you can have yarn watch for changes and automatically recompile them.

yarn watch

Now that you have a ./dist folder, you are ready to run a fresh Grafana instance and put the new version of the datasource into Grafana plugin folder.

Development resources

We provide development resources to make it easier to contribute to and develop the GitHub data source.

Docker Compose

Docker Compose file is available to help you to get started. When you call up docker compose up inside the project folder, it will:

  1. Run a new instance of Grafana from the master branch and map it into port 3000.
  2. Configure the instance to allow an unsigned version of github-datasource to be installed.
  3. Map the current folder contents into /var/lib/grafana/plugins.

This is enough for you to see the GitHub Datasource in the datasource list at http://localhost:3000/datasources/new.

Local GitHub Stats installation

If you make further changes into the code, be sure to run yarn dev again and restart the Grafana instance.

Dev dashboards

You can find example dashboard that uses GitHub data source in dashboards folder.

Create a pull request

After you are good to go, it is time to create a pull request to share your work with the community. Please read more about that here.

Development resources