Skip to content

Latest commit

 

History

History

datasource-basic

Grafana Basic Data Source Plugin example

Build

This template is a starting point for building Grafana data source plugins.

What is a Grafana data source plugin?

Grafana supports a wide range of data sources, including Prometheus, MySQL, and even Datadog. There’s a good chance you can already visualize metrics from the systems you have set up. In some cases, though, you already have an in-house metrics solution that you’d like to add to your Grafana dashboards. Grafana data source plugins enable you to integrate such solutions with Grafana.

Get started

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

Frontend

  1. Install dependencies:

    npm install
  2. Build plugin in development mode or run in watch mode:

    npm run dev
  3. Build plugin in production mode:

    npm run build

Backend

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

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

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

    mage -l

Learn more