A simple http service that generates *.PDF reports from Grafana dashboards.
Runtime requirements
pdflatex
installed and available in PATH.- a running Grafana instance that it can connect to
Build requirements:
Get the source files and dependencies:
go get github.com/izakmarais/reporter/...
Build and install:
go install -v github.com/izakmarais/reporter/cmd/grafana-reporter
Running without any flags assumes Grafana is reachable at localhost:3000:
grafana-reporter
Query available flags:
grafana-reporter --help
The reporter serves a pdf report on the specified port at:
/api/report/{dashBoardName}
where dashBoardName is the same name as used in the Grafana dasbhoard's URL. E.g. backend-dashboard from http://grafana-host:3000/dashboard/db/backend-dashboard.
In addition, the endpoint supports the same time query parameters as Grafana. This means that you can create a Grafana Link and enable the Time range forwarding check-box. The link will render a dashboard with your current dashboard time range.
The unit tests can be run using the go tool:
go get github.com/smartystreets/goconvey
go test -v github.com/izakmarais/reporter/...
or, the GoConvey webGUI:
./bin/goconvey -workDir `pwd`/src/github.com/izakmarais -excludedDirs `pwd`/src/github.com/izakmarais/reporter/tmp/