Grafana Dashboard Reports

Horizon provides three templates to create a PDF report from an existing Grafana dashboard. You can also schedule and email these PDF reports to anyone, meaning you can do the following:

  • Keep staff without access to Horizon informed about network performance for improved capacity planning.

  • Create a permanent record of strategic information and progress over a long period of time.

The PDF report displays each of the panels from the specified dashboard, with one, two, or four panels per page, depending on the selected template.

Example of a Horizon dashboard compared to the corresponding PDF report
Figure 1. Example dashboard compared to PDF report

Before you begin

This feature requires Horizon and an instance of Grafana with at least one dashboard and panel. Horizon lets you create a report for any Grafana dashboard, not just those created using OpenNMS Helm.

You must set Grafana as a data source by configuring the Grafana endpoint in Horizon.

If you are using the Docker image for Grafana, you must complete additional configuration steps. Refer to Grafana’s Remote rendering service documentation for more information on how to set up remote rendering. Additional details are available on GitHub.

Configure Grafana endpoint

Configuring the Grafana endpoint sets Grafana as the data source for the dashboards from which you create PDFs. Follow the steps below to configure the endpoint:

  1. Log in to your Grafana instance.

  2. Choose Configuration  API Keys  New API Key.

  3. Specify a key name and "Viewer" role, and click Add.

    • Leave the Time to Live blank so that the key never expires.

  4. Copy the key to your clipboard.

    Grafana UI displaying a generated API key
    • If desired, use the curl command provided in the API key dialog to test the key.

  5. In Horizon, click Add a Grafana Endpoint:

    Horizon UI displaying a Grafana endpoint error
  6. In the Endpoint Configuration page, click the plus symbol (+) to add a new endpoint.

  7. Enter the required information, and click Test Connection.

  8. Click Create.

You can now use Horizon to create PDF reports of Grafana dashboards.

Create Grafana dashboard report

Follow the steps below to create a PDF report based on a Grafana dashboard:

  1. In the Horizon UI, choose Reports  Database Reports.

  2. Under Report Templates, click Grafana Dashboard Report <Xppp>, where <Xppp> represents the number of panels per page you want to display.

  3. Under Report Parameters, specify the appropriate information (see table below).
    NOTE: The Grafana Endpoint is the data source. Select a Grafana dashboard from the list.

  4. Click Create Report.

    • You are prompted to save the report locally or open it. The file is automatically saved to a folder on the Horizon server. It also appears in the UI in the Persisted Reports tab.

  5. To send the report to someone, click Deliver This Report and fill out the Report Delivery Options.

    • If you select Email Report, specify the recipient’s email address in the Recipient box. Separate multiple recipient email addresses with a comma.

    • You can also use a webhook to post the report to a specified URL.

  6. Click Deliver Report.

  7. To schedule the report for regular delivery, click Schedule This Report.

  8. Specify the report frequency (daily, days per week, and so on) and interval.

  9. Click Schedule Report.

Scheduled reports appear in the Report Schedules tab, where you can edit or delete them:

Horizon UI displaying an example of a scheduled report
Figure 2. Example scheduled report

Parameters

Report customization parameters
Field Description Default Value

Title

Report’s title

Grafana Dashboard Report

Description

Brief description of the report.

Blank

Time Zone

The time zone for the data in the report. A dropdown list provides all available options.

Default system time zone

Start Date

Start date for the report.

Yesterday

End Date

End date for the report.

Today

Format

Format of the report. A dropdown list provides all available options.

PDF