Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/negbie/grafpng
Service that exports a Grafana dashboard as png image
https://github.com/negbie/grafpng
export grafana image png render
Last synced: 3 months ago
JSON representation
Service that exports a Grafana dashboard as png image
- Host: GitHub
- URL: https://github.com/negbie/grafpng
- Owner: negbie
- License: apache-2.0
- Fork: true (IzakMarais/reporter)
- Created: 2019-01-19T18:33:28.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-21T14:26:18.000Z (almost 6 years ago)
- Last Synced: 2024-06-20T11:14:34.454Z (7 months ago)
- Topics: export, grafana, image, png, render
- Language: Go
- Homepage:
- Size: 8.31 MB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# grafpng
A simple http service that generates a *.png image from Grafana dashboards.
## Requirements
Build requirements:
* [golang](https://golang.org/)## Getting started
### Generate a dashboard report
#### Endpoint
The reporter serves a png report on the specified port at:
/api/v5/report/{dashboardUID}
where `{dashboardUID}` is the dashboard uid as used in the Grafana dashboard's URL.
E.g. `SoT6hL6zk` from `http://grafana-host:3000/d/SoT6hL6zk/descriptive-name`.
For more about this uid, see [the Grafana HTTP API](http://docs.grafana.org/http_api/dashboard/#identifier-id-vs-unique-identifier-uid).#### Query parameters
The endpoint supports the following optional query parameters. These can be combined using standard
URL query parameter syntax, eg:/api/v5/report/{dashboardUID}?apitoken=12345&var-host=devbox
**Time span**: The time span query parameter syntax is the same as used by Grafana.
When you create a link from Grafana, you can enable the _Time range_ forwarding check-box.
The link will render a dashboard with your current time range.**variables**: The template variable query parameter syntax is the same as used by Grafana.
When you create a link from Grafana, you can enable the _Variable values_ forwarding check-box.
The link will render a dashboard with your current variable values.**apitoken**: A Grafana authentication api token. Use this if you have auth enabled on Grafana. Syntax: `apitoken={your-tokenstring}`.