grafana-app-with-backend

module
v0.0.0-...-d3948d2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 12, 2024 License: Apache-2.0

README

Grafana App with Backend Plugin example

This template is a starting point for building an app plugin for Grafana. It includes a backend component.

What are Grafana app plugins?

App plugins can let you create a custom out-of-the-box monitoring experience by including custom pages, nested data sources, and panel plugins. A backend allows it to perform a variety of additional tasks, like handling incoming HTTP requests.

Get started

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
    
  4. Run the tests (using Jest)

    # Runs the tests and watches for changes
    npm run test
    
    # Exists after running all the tests
    npm run lint:ci
    
  5. Spin up a Grafana instance and run the plugin inside it (using Docker)

    npm run server
    
  6. Run the E2E tests

    # Spin up a Grafana instance first that we tests against
    npm run server
    
    # Start the tests
    npm run e2e
    
  7. Run the linter

    npm run lint
    
    # or
    
    npm run lint:fix
    
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

Below you can find source code for existing app plugins and other related documentation.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL