All Projects → IzakMarais → Reporter

IzakMarais / Reporter

Licence: apache-2.0
Service that generates a PDF report from a Grafana dashboard

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Reporter

camunda-prometheus-process-engine-plugin
Monitor your KPIs!!! Camunda BPM Process Engine Plugin providing Prometheus Monitoring, Metric classes for various BPMN use, Grafana Annotations, and HTTPServer data export: Used to generate Prometheus metrics anywhere in the Engine, including BPMN, CMN, and DMN engines and instances.
Stars: ✭ 48 (-91.74%)
Mutual labels:  reporting, grafana
nfCollector
Collects Netflow version 1, 5, 6, 7, 9 & IPFIX & stores them on InfluxData time-series DB (InfluxDB)
Stars: ✭ 30 (-94.84%)
Mutual labels:  grafana, grafana-dashboard
nifi-prometheus-reporter
A reporting task in Nifi which is capable of sending monitoring statistics as prometheus metrics to a prometheus pushgateway.
Stars: ✭ 48 (-91.74%)
Mutual labels:  grafana, grafana-dashboard
Prometheus-grafana
Monitor your Kubernetes cluster resources and applications
Stars: ✭ 21 (-96.39%)
Mutual labels:  grafana, grafana-dashboard
Prometheus
A docker-compose stack for Prometheus monitoring
Stars: ✭ 3,383 (+482.27%)
Mutual labels:  grafana, grafana-dashboard
victoriametrics-ru-links
Список постов и видеозаписей об VictoriaMetrics на русском языке
Stars: ✭ 1 (-99.83%)
Mutual labels:  grafana, grafana-dashboard
fronius-to-influx
Collect Fronius inverter data and save in Influxdb for Grafana
Stars: ✭ 31 (-94.66%)
Mutual labels:  grafana, grafana-dashboard
idrac snmp-grafana
SNMP Based Dashboard to Monitor Dell Hosts via iDRAC
Stars: ✭ 88 (-84.85%)
Mutual labels:  grafana, grafana-dashboard
atop-graphite-grafana-monitoring
Tools to extract raw system counters from atop, aggregate them to generate high level performance metrics, whose are then injected into a Graphite database and visualize through Grafana dashboards.
Stars: ✭ 15 (-97.42%)
Mutual labels:  grafana, grafana-dashboard
ruuvitag-demo
Demo of reading Bluetooth Low Energy sensor measurements of RuuviTag environmental sensors and feeding them to MQTT, a database and dashboards
Stars: ✭ 14 (-97.59%)
Mutual labels:  grafana, grafana-dashboard
grafana-aws-cost-explorer-backend
Grafana Backend for AWS Cost Explorer
Stars: ✭ 24 (-95.87%)
Mutual labels:  grafana, grafana-dashboard
Pihole Exporter
A Prometheus exporter for PI-Hole's Raspberry PI ad blocker
Stars: ✭ 352 (-39.41%)
Mutual labels:  grafana, grafana-dashboard
kafka-consumer-lag-monitoring
Client tool that exports the consumer lag of Kafka consumer groups to Prometheus or your terminal
Stars: ✭ 45 (-92.25%)
Mutual labels:  grafana, grafana-dashboard
tado-exporter
A Prometheus exporter for tado smart heating solution
Stars: ✭ 32 (-94.49%)
Mutual labels:  grafana, grafana-dashboard
burrow-kafka-dashboard
Kubernetes Kafka Overview, Burrow consumer lag stats, Kafka disk usage
Stars: ✭ 37 (-93.63%)
Mutual labels:  grafana, grafana-dashboard
grafonnet-playground
Playground for grafanna with jsonnet
Stars: ✭ 25 (-95.7%)
Mutual labels:  grafana, grafana-dashboard
ruby-grafana-reporter
Reporting Service for Grafana
Stars: ✭ 42 (-92.77%)
Mutual labels:  reporting, grafana
yearn-exporter
Realtime and historical Yearn metrics
Stars: ✭ 80 (-86.23%)
Mutual labels:  grafana, grafana-dashboard
jmeterReports
Jmeter autogenerater reports after test to Confluence, using grafana custom dushboards.
Stars: ✭ 23 (-96.04%)
Mutual labels:  reporting, grafana
Grabana
User-friendly Go library for building Grafana dashboards
Stars: ✭ 313 (-46.13%)
Mutual labels:  grafana, grafana-dashboard

Grafana reporter

A simple http service that generates *.PDF reports from Grafana dashboards.

demo

Requirements

Runtime requirements

  • pdflatex installed and available in PATH.
  • a running Grafana instance that it can connect to. If you are using an old Grafana (version < v5.0), see Deprecated Endpoint below.

Build requirements:

Getting started

Build and run

Get the source files and dependencies:

go get github.com/IzakMarais/reporter/...

Build and install grafana-reporter binary to $GOPATH/bin:

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. Likely the only one you need to set is -ip.

grafana-reporter --help
-cmd_apiKey string
      Grafana api key. Required (and only used) in command line mode.
-cmd_apiVersion string
      Api version: [v4, v5]. Required (and only used) in command line mode, example: -apiVersion v5. (default "v5")
-cmd_dashboard string
      Dashboard identifier. Required (and only used) in command line mode.
-cmd_enable
      Enable command line mode. Generate report from command line without starting webserver (-cmd_enable=1).
-cmd_o string
      Output file. Required (and only used) in command line mode. (default "out.pdf")
-cmd_template string
      Specify a custom TeX template file. Only used in command line mode, but is optional even there.
-cmd_ts string
      Time span. Required (and only used) in command line mode. (default "from=now-3h&to=now")
-grid-layout
      Enable grid layout (-grid-layout=1). Panel width and height will be calculated based off Grafana gridPos width and height.
-ip string
      Grafana IP and port. (default "localhost:3000")
-port string
      Port to serve on. (default ":8686")
-proto string
      Grafana Protocol. Change to 'https://' if Grafana is using https. Reporter will still serve http. (default "http://")
-ssl-check
      Check the SSL issuer and validity. Set this to false if your Grafana serves https using an unverified, self-signed certificate. (default true)
-templates string
      Directory for custom TeX templates. (default "templates/")

Generate a dashboard report

Endpoint

The reporter serves a pdf 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.

Deprecated Endpoint

In Grafana v5.0, the Grafana HTTP API for dashboards was changed. The reporter still works with the previous Grafana API too, but serves pdf reports at a different endpoint. So, if you use Grafana v4, you need to download your reports from here instead:

/api/report/{dashboardname}

where {dashboardname} is the same name as used in the Grafana v4 dashboard's URL. E.g. backend-dashboard from http://grafana-host:3000/dashboard/db/backend-dashboard. This endpoint is deprecated and may be dropped in a future release of the grafana-reporter.

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.
By default, the time range will be included as the report sub-title. Times are displayed using the reporter's host server time zone.

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}. If you are getting Got Status 401 Unauthorized, message: {"message":"Unauthorized"} error messages, typically it is because you forgot to set this parameter.

template: Optionally specify a custom TeX template file. Syntax template=templateName implies the grafana-reporter should have access to a template file on the server at templates/templateName.tex. The templates directory can be set with a command line parameter. See the LaTeX code in texTemplate.go as an example of what variables are available and how to access them. Also see this issue for an example.

Command line mode

If you prefer to generate a report directly from the command line without running a webserver, command line mode enables this. All flags related to command line mode are prefixed with cmd_ to distinguish them from regular flags:

grafana-reporter -cmd_enable=1 -cmd_apiKey [api-key] -ip localhost:3000 -cmd_dashboard ITeTdN2mk -cmd_ts from=now-1y -cmd_o out.pdf

Docker examples (optional)

A Docker image is available. To see available flags:

docker run izakmarais/grafana-reporter --help

To run with default flags, use --net to enable Docker to connect to Grafana at localhost:3000:

docker run -p 8686:8686 --net="host" izakmarais/grafana-reporter

If you also have Make and Docker-compose installed, you can run a simple local orchestration of Grafana and Grafana-reporter:

 go get github.com/IzakMarais/reporter/ ...
 cd $GOPATH/src/github.com/IzakMarais/reporter
 make compose-up

Then open a browser to http://localhost:3000 and create a new test dashboard. Add the example graph and save the dashboard. Observe the new URL and find the dashboard UID, e.g. qaJCuCezz from http://localhost:3000/d/qaJCuCezz/new-dashboard-copy Next, go to: http://localhost:8080/api/v5/report/qaJCuCezz, which will output the grafana-reporter PDF.

Development

Test

The unit tests can be run using the go tool:

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/

Release

A new release requires changes to the git tag, cmd/grafana-reporter/version.go and Makefile: docker-build job.

Build the Docker image and push to Dockerhub. Build the Windows and Linux binaries and upload to Github using make buildall.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].