Plugins 〉Grafana Image Renderer

Renderer
grafana

Grafana Image Renderer

  • Overview
  • Installation
  • Change log
  • Related content

A Grafana backend plugin that handles rendering panels and dashboards to PNGs using a headless browser (Chromium).

Requirements

Supported operating systems

  • Linux (x64)
  • Windows (x64)
  • Mac OS X (x64)

Dependencies

This plugin is packaged in a single executable with Node.js runtime and Chromium browser. This means that you don't need to have Node.js and Chromium installed in your system for the plugin to function.

However, the Chromium browser depends on certain libraries. If you don't have all of those libraries installed in your system, you may see some errors when you try to render an image. For more information including troubleshooting help, refer to Grafana Image Rendering documentation.

Memory requirements

Rendering images requires a lot of memory, mainly because Grafana creates browser instances in the background for the actual rendering. We recommend a minimum of 16GB of free memory on the system rendering images.

Rendering multiple images in parallel requires an even bigger memory footprint. You can use the remote rendering service in order to render images on a remote system, so your local system resources are not affected.

Plugin installation

You can install the plugin using Grafana CLI (recommended way) or with Grafana Docker image.

Grafana CLI (recommended)

grafana-cli plugins install grafana-image-renderer

Grafana Docker image

This plugin is not compatible with the current Grafana Docker image and requires additional system-level dependencies. We recommend setting up another Docker container for rendering and using remote rendering instead. For instruction, refer to Run in Docker.

If you still want to install the plugin with the Grafana Docker image, refer to the instructions on building a custom Grafana image in Grafana Docker documentation.

Remote rendering service installation

Note: Requires an internet connection.

You can run this plugin as a remote HTTP rendering service. In this setup, Grafana renders an image by making an HTTP request to the remote rendering service, which in turn renders the image and returns it back in the HTTP response to Grafana.

You can run the remote HTTP rendering service using Docker or as a standalone Node.js application.

Run in Docker

Grafana Docker images are published at Docker Hub.

The following example shows how you can run Grafana and the remote HTTP rendering service in two separate Docker containers using Docker Compose.

  1. Create a docker-compose.yml with the following content:
version: '2'

services: grafana: image: grafana/grafana:latest ports: - ‘3000:3000’ environment: GF_RENDERING_SERVER_URL: http://renderer:8081/render GF_RENDERING_CALLBACK_URL: http://grafana:3000/ GF_LOG_FILTERS: rendering:debug renderer: image: grafana/grafana-image-renderer:latest ports: - 8081

  1. Next, run docker compose.
docker-compose up

Run as standalone Node.js application

The following example describes how to build and run the remote HTTP rendering service as a standalone Node.js application and configure Grafana appropriately.

  1. Clone the Grafana image renderer plugin Git repository.

  2. Install dependencies and build:

    yarn install --pure-lockfile
    yarn run build
    
  3. Run the server:

    node build/app.js server --port=8081
    
  4. Update Grafana configuration:

    [rendering]
    server_url = http://localhost:8081/render
    callback_url = http://localhost:3000/
    
  5. Restart Grafana.

Configuration

For available configuration settings, please refer to Grafana Image Rendering documentation.

Troubleshooting

For troubleshooting help, refer to Grafana Image Rendering troubleshooting documentation.

For more information, visit the docs on plugin installation.

3.2.1 (2021-10-07)

3.2.0 (2021-09-17)

  • Docs: Update documentation to improve visibility and avoid duplicates with Grafana documentation #277, AgnesToulet
  • Instrumentation: Update grafana_image_renderer_step_duration_seconds buckets #287, AgnesToulet
  • Security: Bump chokidar from 3.5.1 to 3.5.2 #284, AgnesToulet
  • Instrumentation: Add gauge of total number of requests in flight #281, AgnesToulet
  • Security: Bump axios from 0.21.1 to 0.21.4 #283, dependabot[bot]
  • Chore: Add self-contained setup for load test #275, pianohacker

3.1.0 (2021-09-01)

Important change

The default Chromium flags have been updated to include --disable-gpu as it fixes memory leaks issues when using the default rendering mode. If you don't want to use this flag, you need to update your service configuration, either through the service configuration file, the environment variables or the Grafana configuration file (if you're using the plugin mode).

3.0.1 (2021-06-10)

  • Browser: Fix panel timezone when the timezone query parameter is specified #224, Bujupah
  • Docker: Fix version endpoint for Docker images #248, mbentley

3.0.0 (2021-06-07)

3.0.0-beta2 (2021-05-26)

3.0.0-beta1 (2021-05-19)

2.1.1 (2021-05-18)

2.1.0 (2021-05-11)

  • Chore/Security: Upgrade dependencies and bump Node to LTS (14.16.1) #218, AgnesToulet

2.0.1 (2021-01-26)

  • Browser: Use timeout parameter for initial navigation to the dashboard being rendered #171,

2.0.0 (2020-05-16)

  • Plugin: Migrate to @grpc/grpc-js to resolve problems when IPv6 is disabled #135, aknuds1
  • Adds support for new Grafana backend plugin system #128, marefr
  • Browser: Adds support for setting viewport device scale factor #128, marefr
  • Browser: Adds support for attaching Accept-Language header to support render is name locale as Grafana user #128, marefr
  • Browser: Fail render if the URL has socket protocol #127, aknuds1
  • Chore: Upgrade typescript dependencies #129, marefr

2.0.0-beta1 (2020-04-22)

  • Adds support for new Grafana backend plugin system #128, marefr
  • Browser: Adds support for setting viewport device scale factor #128, marefr
  • Browser: Adds support for attaching Accept-Language header to support render is name locale as Grafana user #128, marefr
  • Browser: Fail render if the URL has socket protocol #127, aknuds1
  • Chore: Upgrade typescript dependencies #129, marefr

1.0.12 (2020-03-31)

  • Remote rendering: Delete temporary file after serving it to client #120, marefr
  • Remote rendering: More configuration options #123, marefr

1.0.12-beta1 (2020-03-30)

  • Remote rendering: More configuration options #123, marefr

1.0.11 (2020-03-20)

  • Render: Add support for enabling verbose logging using environment variable #105, marefr
  • Render: Fix panel titles should not be focused when rendering #114, AgnesToulet
  • Security: Upgrade minimist dependency to v1.2.5 #118, marefr

1.0.10 (2020-02-18)

  • Plugin: Fix unable to start Grafana (Windows) with version 1.0.8 and 1.0.9 #103, marefr

1.0.9 (2020-01-30)

  • Remote rendering: Improve error handling, logging and metrics #92, marefr
    • Service: Don't swallow exceptions and fix logging of parameters
    • Metrics: Use status 499 when client close the connection
    • Docker: Set NODE_ENV=production
    • Changed request logging to use debug level if status < 400 and error if >= 400
  • Plugin: Adds icon #95, marefr

1.0.8 (2020-01-20)

  • Build: Upgrade Node.js requirement to LTS (v12) #57, marefr
  • Docker: Add unifont font to support rendering other language, like Chinese/Japanese #75, okhowang
  • Subscribing to page events to catch errors from browser #88, marefr
  • Plugin: Automatically assign grpc port per default #87, marefr
  • Plugin: Support configuring default timezone thru environment variable #86, marefr
  • Remote rendering: Support configuring default timezone thru config file and environment variable #86, marefr
  • Remote rendering: Support configuring HTTP host and port thru config and environment variables #40, marefr
  • Remote rendering: Support reading config from file #73, marefr
  • Remote rendering: Collect and expose Prometheus metrics #71, marefr

Breaking changes

  • Plugin now automatically assigns gPRC port not in use. Before port 50059 was used. You can change this by using the GF_RENDERER_PLUGIN_GRPC_PORT environment variable.

1.0.8-beta1 (2019-12-17)

  • Remote rendering: Collect and expose Prometheus metrics #71, marefr
  • Build: Upgrade Node.js requirement to LTS (v12) #57, marefr

1.0.7 (2019-12-03)

  • Provide correctly named config parameter to Chromium when overriding to skip https errors using environment variable GF_RENDERER_PLUGIN_IGNORE_HTTPS_ERRORS and/or IGNORE_HTTPS_ERRORS #62, marefr

1.0.6 (2019-11-25)

  • Wait until all network connections to be idle before rendering #24, d1ff
  • Support ignoring https errors using environment variable #59, marefr
  • Docker: Update dependencies to remove vulnerabilities #53, marefr
  • Fix typo in log statement #39, ankon
  • Updated documentation

1.0.5 (2019-09-11)

  • Include md5 checksums in release artifacts

1.0.4 (2019-09-11)

  • Update readme and docs

1.0.3 (2019-09-10)

  • Automate docker release

1.0.2 (2019-09-10)

  • Don't include dist directory in archive (zip) files

1.0.1 (2019-09-09)

  • Switch docker base image from node:10 to node:alpine-10 #36, marefr
  • Updated the panel render wait function to account for Grafana version 6 #26, bmichaelis
  • Updated dependencies

1.0.0 (2019-08-16)

Initial release containing prebuilt binaries available for download. Right now the binaries themselves should be considered alpha as they need more testing.