| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| |
| # Grafana Data Source Backend Plugin Template |
| |
| [](https://github.com/grafana/grafana-datasource-backend/actions?query=workflow%3A%22CI%22) |
| |
| This template is a starting point for building Grafana Data Source Backend Plugins |
| |
| ## What is Grafana Data Source Backend 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 enables integrating such solutions with Grafana. |
| |
| For more information about backend plugins, refer to the documentation on [Backend plugins](https://grafana.com/docs/grafana/latest/developers/plugins/backend/). |
| |
| ## Getting started |
| |
| A data source backend plugin consists of both frontend and backend components. |
| |
| ### Frontend |
| |
| 1. Install dependencies |
| |
| ```bash |
| yarn install |
| ``` |
| |
| 2. Build plugin in development mode or run in watch mode |
| |
| ```bash |
| yarn dev |
| ``` |
| |
| or |
| |
| ```bash |
| yarn watch |
| ``` |
| |
| 3. Build plugin in production mode |
| |
| ```bash |
| yarn build |
| ``` |
| |
| ### Backend |
| |
| 1. Update [Grafana plugin SDK for Go](https://grafana.com/docs/grafana/latest/developers/plugins/backend/grafana-plugin-sdk-for-go/) dependency to the latest minor version: |
| |
| ```bash |
| go get -u github.com/grafana/grafana-plugin-sdk-go |
| go mod tidy |
| ``` |
| |
| 2. Build backend plugin binaries for Linux, Windows and Darwin: |
| |
| ```bash |
| mage -v |
| ``` |
| |
| 3. List all available Mage targets for additional commands: |
| |
| ```bash |
| mage -l |
| ``` |
| |
| ## Learn more |
| |
| - [Build a data source backend plugin tutorial](https://grafana.com/tutorials/build-a-data-source-backend-plugin) |
| - [Grafana documentation](https://grafana.com/docs/) |
| - [Grafana Tutorials](https://grafana.com/tutorials/) - Grafana Tutorials are step-by-step guides that help you make the most of Grafana |
| - [Grafana UI Library](https://developers.grafana.com/ui) - UI components to help you build interfaces using Grafana Design System |
| - [Grafana plugin SDK for Go](https://grafana.com/docs/grafana/latest/developers/plugins/backend/grafana-plugin-sdk-for-go/) |