chrispappas / grafana-kitchen-sink

Simple toy example based on tutorials for how to build a Grafana plugin w/ simple golang backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grafana "Kitchen Sink" Example

This project is a simple demo of how to use grafana plugins with a simple golang based http server backend, deployed and run using docker-compose

Go-based http server

We will simply follow the Developing a RESTful API with Go and Gin tutorial from the official golang docs site

Accessible at http://localhost:8080/albums (see the tutorial for more endpoints)

When making changes to the app, rebuild and restart the docker container:

docker-compose up -d --force-recreate --build api

Grafana

Grafana is run in a docker container on port 3000

The plugins need to be built before they can be used in grafana, run yarn dev to compile, or yarn watch to watch for changes and automatically recompile. Remember to restart grafana if adding a new plugin.

Running the example

Use docker-compose to start the golang api server on :8080 and Grafana on :3000

Grafana will load the plugins as they currently exist on the filesystem, use docker-compose restart grafana to load any new plugins. The container is bound to the filesystem so you don't need to restart the container when recompiling an existing plugin (only when adding a new one).

About

Simple toy example based on tutorials for how to build a Grafana plugin w/ simple golang backend

License:The Unlicense


Languages

Language:TypeScript 68.3%Language:Go 28.5%Language:Dockerfile 1.9%Language:JavaScript 1.3%