https://github.com/toddtreece/grafana-grpc-server-example-datasource
https://github.com/toddtreece/grafana-grpc-server-example-datasource
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/toddtreece/grafana-grpc-server-example-datasource
- Owner: toddtreece
- License: apache-2.0
- Created: 2022-09-14T17:14:58.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-07T02:59:30.000Z (over 3 years ago)
- Last Synced: 2025-02-14T05:30:59.794Z (over 1 year ago)
- Language: Go
- Size: 2.05 MB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## gRPC Server query proxy example
This demonstrates making `QueryDataRequest` calls from a backend plugin to the experimental Grafana gRPC server by proxying queries through this plugin and modifying the datasource ref.
In the grafana repo:
```
git fetch
git checkout toddtreece/grpc-server-plugin-protobuf
```
`grafana.ini` changes:
```ini
[feature_toggles]
grpcServer = true
```
[Example Query](https://user-images.githubusercontent.com/360020/192410785-cc0913eb-139c-4783-b48c-db8e97f0dc55.webm)
### 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/)