Giter Site home page Giter Site logo

grafana / grafana-image-renderer Goto Github PK

View Code? Open in Web Editor NEW
357.0 133.0 152.0 29.33 MB

A Grafana backend plugin that handles rendering of panels & dashboards to PNGs using headless browser (Chromium/Chrome)

License: Apache License 2.0

Makefile 1.03% Shell 3.89% TypeScript 74.54% Dockerfile 2.02% JavaScript 9.19% Jsonnet 0.38% Starlark 8.95%
grafana grafana-backend-plugin docker

grafana-image-renderer's Introduction

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
  2. 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.

Security

Access to the rendering endpoints is restricted to requests providing an auth token. This token should be configured in the Grafana configuration file and the renderer configuration file. This token is important when you run the plugin in remote rendering mode to avoid unauthorized file disclosure (see CVE-2022-31176).

See Grafana Image Rendering documentation to configure this secret token. The default value - is configured on both Grafana and the image renderer when you get started but we strongly recommend you to update this to a more secure value.

Configuration

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

Troubleshooting

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

Testing

In order to run the image-renderer automated test suites, you need to run the following command from the root folder:

yarn test

This will launch a Grafana instance in Docker and, then, run the test suites.

Notes:

If there are some expected changes in the reference image files (located in /tests/testdata), run yarn test-update and push the updated references.

If the tests are failing and you want to see the difference between the image you get and the reference image, run yarn test-diff. This will generate images (called diff_<test case>.png) containing the differences in the /tests/testdata folder.

Fixing Drone issues

If tests are successful in your local environement but fail in Drone. You can follow these steps to run the tests in an environment similar to the Drone pipeline. This will mount your local files of the grafana-image-renderer repo in the Docker image so any change that happens in the Docker image will be available in your local environment. This allows you to run yarn test-diff and yarn test-update in Docker and see the results locally.

  1. Run the Drone environment in Docker:
cd ./devenv/docker/drone
docker-compose up
  1. Open a terminal within the drone-docker-puppeteer container and run the following commands:
cd /drone/src
PUPPETEER_CACHE_DIR=/drone/src/cache yarn install --frozen-lockfile --no-progress
PUPPETEER_CACHE_DIR=/drone/src/cache CI=true yarn test-ci

Notes: The tests might take longer in the Docker container. If you run into timeout issues, you can run the test command with the --testTimeout option:

PUPPETEER_CACHE_DIR=/drone/src/cache CI=true yarn test-ci --testTimeout=10000

grafana-image-renderer's People

Contributors

agnestoulet avatar aknuds1 avatar ankon avatar aocenas avatar arturwierzbicki avatar bergquist avatar bujupah avatar clarity-89 avatar d1ff avatar dancech avatar daniellee avatar dependabot[bot] avatar evictorero avatar hboomsma avatar joanlopez avatar kaey avatar kaffarell avatar marefr avatar mbentley avatar michbeck100 avatar pianohacker avatar river2000i avatar ryantxu avatar sadfacesmith avatar simonc6372 avatar sozercan avatar spinillos avatar torkelo avatar w4rgrum avatar wardbekker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grafana-image-renderer's Issues

How to install in container based Grafana install?

I am running the latest Grafana container build which means I don't have a way to do:

git clone into Grafana external plugins folder.
yarn install --pure-lockfile
yarn run build
restart grafana-server , it should log output that the renderer plugin was found and started.

Is there no way to just install this from the plugins browser for Grafana?

plugin_start_linux_amd64 start script for linux missing

I've got the following error.

EROR[] Server shutdown                          logger=server reason="fork/exec .../grafana-image-renderer/plugin_start_linux_amd64: no such file or directory"

fixed it for me temporary by copy the plugin_start_darwin_amd64 to plugin_start_linux_amd64 which seems to work fine.

http 500 Error with image renderer Plugin

What happened:

Hello all, I am running Grafana and integrated dashboards into icingaweb2. But wenn I open a page in icingaweb2 the dashboard of grafana does not appear. In the grafana logs I find the following entries:

Jan 03 10:27:24 grafana grafana-server[949]: t=2020-01-03T10:27:24+0000 lvl=eror msg="Rendering failed." logger=context userId=0 orgId=1 uname= error="rpc error: code = Canceled desc = context canceled" Jan 03 10:27:24 grafana grafana-server[949]: t=2020-01-03T10:27:24+0000 lvl=eror msg="Request Completed" logger=context userId=0 orgId=1 uname= method=GET path=/render/d-solo/ZK27sqXmz/icinga2-default status=500 remote_addr=10.x.x.x time_ms=4985 size=1722 referer= Jan 03 10:27:44 grafana grafana-server[949]: t=2020-01-03T10:27:44+0000 lvl=eror msg="Render request failed" logger=rendering url="h2://localhost:3000/d-solo/ZK27sqXmz/icinga2-default?var-hostname=servername.local&var-service=ping4&var-command=ping4&panelId=1&orgId=1&width=640&height=280&theme=light&from=now-6h&to=now&render=1" error=map[name:TimeoutError] timestamp=0001-01-01T00:00:00.000Z

When i click on the panel in icingaweb2 where the grafana dashboard should appear I immediatelly see the right dashboard...

What you expected to happen:
Dashboard would open up :-)

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:
I have installed Grafana via deb File und downloaded Grafana Image Renderer Version 1.0.7 via github und unzipped it in /var/lib/grafana/plugins and chmoded user to grafana:grafana afterward I checked ldd dependencies and they seemed to be fine...
linux-vdso.so.1 (0x00007ffd8d932000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f34b4a3c000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f34b481d000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f34b4615000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f34b42dd000) libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f34b40db000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f34b3eb3000) libXcomposite.so.1 => /usr/lib/x86_64-linux-gnu/libXcomposite.so.1 (0x00007f34b3cb0000) libXcursor.so.1 => /usr/lib/x86_64-linux-gnu/libXcursor.so.1 (0x00007f34b3aa6000) libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f34b38a3000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f34b3691000) libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f34b348b000) libXi.so.6 => /usr/lib/x86_64-linux-gnu/libXi.so.6 (0x00007f34b327b000) libXrender.so.1 => /usr/lib/x86_64-linux-gnu/libXrender.so.1 (0x00007f34b3071000) libXtst.so.6 => /usr/lib/x86_64-linux-gnu/libXtst.so.6 (0x00007f34b2e6b000) libgobject-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0 (0x00007f34b2c17000) libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f34b2900000) libnss3.so => /usr/lib/x86_64-linux-gnu/libnss3.so (0x00007f34b25bc000) libnssutil3.so => /usr/lib/x86_64-linux-gnu/libnssutil3.so (0x00007f34b238d000) libsmime3.so => /usr/lib/x86_64-linux-gnu/libsmime3.so (0x00007f34b2161000) libnspr4.so => /usr/lib/x86_64-linux-gnu/libnspr4.so (0x00007f34b1f24000) libcups.so.2 => /usr/lib/x86_64-linux-gnu/libcups.so.2 (0x00007f34b1c98000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f34b1a66000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f34b1819000) libXss.so.1 => /usr/lib/x86_64-linux-gnu/libXss.so.1 (0x00007f34b1615000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f34b140e000) libXrandr.so.2 => /usr/lib/x86_64-linux-gnu/libXrandr.so.2 (0x00007f34b1203000) libgio-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgio-2.0.so.0 (0x00007f34b0e64000) libasound.so.2 => /usr/lib/x86_64-linux-gnu/libasound.so.2 (0x00007f34b0b5d000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f34b07bf000) libpangocairo-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangocairo-1.0.so.0 (0x00007f34b05b2000) libpango-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpango-1.0.so.0 (0x00007f34b0365000) libcairo.so.2 => /usr/lib/x86_64-linux-gnu/libcairo.so.2 (0x00007f34b0048000) libatk-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-1.0.so.0 (0x00007f34afe22000) libatk-bridge-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0 (0x00007f34afbf1000) libgtk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgtk-3.so.0 (0x00007f34af2e9000) libgdk-3.so.0 => /usr/lib/x86_64-linux-gnu/libgdk-3.so.0 (0x00007f34aeff3000) libgdk_pixbuf-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgdk_pixbuf-2.0.so.0 (0x00007f34aedcf000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f34aebb7000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f34ae7c6000) /lib64/ld-linux-x86-64.so.2 (0x00007f34bda30000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f34ae5c2000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f34ae3bc000) libffi.so.6 => /usr/lib/x86_64-linux-gnu/libffi.so.6 (0x00007f34ae1b4000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f34adf42000) libplc4.so => /usr/lib/x86_64-linux-gnu/libplc4.so (0x00007f34add3d000) libplds4.so => /usr/lib/x86_64-linux-gnu/libplds4.so (0x00007f34adb39000) libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f34ad8ee000) libgnutls.so.30 => /usr/lib/x86_64-linux-gnu/libgnutls.so.30 (0x00007f34ad589000) libavahi-common.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-common.so.3 (0x00007f34ad37d000) libavahi-client.so.3 => /usr/lib/x86_64-linux-gnu/libavahi-client.so.3 (0x00007f34ad16c000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f34acf4f000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f34acccb000) libgmodule-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0 (0x00007f34acac7000) libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f34ac89f000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f34ac684000) libmount.so.1 => /lib/x86_64-linux-gnu/libmount.so.1 (0x00007f34ac430000) libfontconfig.so.1 => /usr/lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f34ac1eb000) libpangoft2-1.0.so.0 => /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0 (0x00007f34abfd5000) libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f34abd21000) libthai.so.0 => /usr/lib/x86_64-linux-gnu/libthai.so.0 (0x00007f34abb18000) libpixman-1.so.0 => /usr/lib/x86_64-linux-gnu/libpixman-1.so.0 (0x00007f34ab873000) libpng16.so.16 => /usr/lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f34ab641000) libxcb-shm.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-shm.so.0 (0x00007f34ab43e000) libxcb-render.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-render.so.0 (0x00007f34ab231000) libatspi.so.0 => /usr/lib/x86_64-linux-gnu/libatspi.so.0 (0x00007f34ab001000) libcairo-gobject.so.2 => /usr/lib/x86_64-linux-gnu/libcairo-gobject.so.2 (0x00007f34aadf8000) libepoxy.so.0 => /usr/lib/x86_64-linux-gnu/libepoxy.so.0 (0x00007f34aaaf7000) libXinerama.so.1 => /usr/lib/x86_64-linux-gnu/libXinerama.so.1 (0x00007f34aa8f4000) libxkbcommon.so.0 => /usr/lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f34aa6b5000) libwayland-cursor.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-cursor.so.0 (0x00007f34aa4ad000) libwayland-egl.so.1 => /usr/lib/x86_64-linux-gnu/libwayland-egl.so.1 (0x00007f34aa2ab000) libwayland-client.so.0 => /usr/lib/x86_64-linux-gnu/libwayland-client.so.0 (0x00007f34aa09c000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f34a9e87000) libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f34a9bb1000) libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f34a997f000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f34a977b000) libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f34a9570000) libp11-kit.so.0 => /usr/lib/x86_64-linux-gnu/libp11-kit.so.0 (0x00007f34a9241000) libidn2.so.0 => /usr/lib/x86_64-linux-gnu/libidn2.so.0 (0x00007f34a9024000) libunistring.so.2 => /usr/lib/x86_64-linux-gnu/libunistring.so.2 (0x00007f34a8ca6000) libtasn1.so.6 => /usr/lib/x86_64-linux-gnu/libtasn1.so.6 (0x00007f34a8a93000) libnettle.so.6 => /usr/lib/x86_64-linux-gnu/libnettle.so.6 (0x00007f34a885d000) libhogweed.so.4 => /usr/lib/x86_64-linux-gnu/libhogweed.so.4 (0x00007f34a8629000) libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007f34a83a8000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f34a8182000) liblz4.so.1 => /usr/lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f34a7f66000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f34a7c4b000) libblkid.so.1 => /lib/x86_64-linux-gnu/libblkid.so.1 (0x00007f34a79fe000) libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f34a7760000) libdatrie.so.1 => /usr/lib/x86_64-linux-gnu/libdatrie.so.1 (0x00007f34a7559000) libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f34a7355000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f34a7140000) libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f34a6f13000)

grafana.ini
` [rendering]

Options to configure a remote HTTP image rendering service, e.g. using https://github.com/grafana/grafana-image-renderer.

URL to a remote HTTP image renderer service, e.g. http://localhost:8081/render, will enable Grafana to render panels and dashboards to PNG-images using HTTP requests to an external service.

;server_url =

If the remote HTTP image renderer service runs on a different server than the Grafana server you may have to configure this to a URL where Grafana is reachable, e.g. http://grafana.domain/.

;callback_url =`

Environment:

Images render but don't load in emails

running the docker, i finally got my grafana docker and the renderer docker to talk and the logs don't show any errors. However emails come through looking like this.
image

using grafana 6.0 and external image storage is not set.

Improve Rendering Times

Currently it takes my system about 12 seconds to render a graph image. Previous to installing this plugin it took about 2 seconds. I understand we likely can't get it back down to 2 seconds as more is involved with the plugin, but getting it down under double digits, preferably sub-5 seconds would be awesome.

rendering legend

hi guys, sorry if this is not an issue... but i cant find a way to render a graph including the legend-as-table to the right... is this an issue or didnt i rtfm well.. i "only" get the graph itself

thanks and thanks for the work on this priceless plugin

Remote rendering: Collect and expose Prometheus metrics

What would you like to be added:
Collect and expose Prometheus metrics when running as remote rendering service.

Why is this needed:
To make it easier to monitor and understand how the service and node process performs.

Build from source not working on Fedora 31

Hi @marefr,

I tried building from source on Fedora 31 without success.

See,

$ rpm -q yarn nodejs
yarn-1.19.2-1.noarch
nodejs-12.13.0-7.fc31.x86_64
$ make deps
install frontend dependencies
yarn install --pure-lockfile --no-progress
yarn install v1.19.2
[1/4] Resolving packages...
warning Resolution field "[email protected]" is incompatible with requested version "set-value@^0.4.3"
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /home/mt/git/grafana-image-renderer.git/node_modules/grpc: Command failed.
Exit code: 1
Command: ./node_modules/.bin/node-pre-gyp install --fallback-to-build --library=static_library
Arguments: 
Directory: /home/mt/git/grafana-image-renderer.git/node_modules/grpc
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using [email protected]
node-pre-gyp info using [email protected] | linux | x64
node-pre-gyp info check checked for "/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node" (not found)
node-pre-gyp http GET https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v72-linux-x64-glibc.tar.gz
node-pre-gyp http 403 https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v72-linux-x64-glibc.tar.gz
node-pre-gyp WARN Tried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v72-linux-x64-glibc.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp http 403 status code downloading tarball https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.11.3/node-v72-linux-x64-glibc.tar.gz 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.7.5 found at "/usr/bin/python"
gyp http GET https://nodejs.org/download/release/v12.13.0/node-v12.13.0-headers.tar.gz
gyp http 200 https://nodejs.org/download/release/v12.13.0/node-v12.13.0-headers.tar.gz
gyp http GET https://nodejs.org/download/release/v12.13.0/SHASUMS256.txt
gyp http 200 https://nodejs.org/download/release/v12.13.0/SHASUMS256.txt
gyp info spawn /usr/bin/python
gyp info spawn args [
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/home/mt/git/grafana-image-renderer.git/node_modules/grpc/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/home/mt/.cache/node-gyp/12.13.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/home/mt/.cache/node-gyp/12.13.0',
gyp info spawn args   '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/home/mt/.cache/node-gyp/12.13.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/home/mt/git/grafana-image-renderer.git/node_modules/grpc',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok 
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make[1]: Entering directory '/home/mt/git/grafana-image-renderer.git/node_modules/grpc/build'
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/avl/avl.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/backoff/backoff.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_args.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/channel_stack_builder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/connected_channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/channel/handshaker_registry.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/compression_internal.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/message_compress.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_gzip.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/compression/stream_compression_identity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/stats_data.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/format_request.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/httpcli.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/http/parser.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/call_combiner.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/combiner.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/endpoint_pair_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/error.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epoll1_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollex_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_epollsig_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_poll_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/ev_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/exec_ctx.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/executor.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/fork_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_fallback.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_host_name_max.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/gethostname_sysconf.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iocp_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/iomgr_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/is_epollexclusive_available.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/load_file.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/lockfree_event.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/network_status_tracker.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/polling_entity.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_set_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/pollset_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resolve_address_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/resource_quota.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/sockaddr_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_factory_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_mutator.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_common_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_linux.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_utils_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/socket_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_client_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_common.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_server_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/tcp_windows.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/time_averaged_stats.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_generic.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_heap.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_manager.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/timer_uv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/udp_server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/unix_sockets_posix_noop.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_cv.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_eventfd.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_nospecial.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_pipe.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/iomgr/wakeup_fd_posix.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_reader.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/json/json_writer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/b64.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/percent_encoding.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_buffer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_hash_table.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_intern.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/slice/slice_string_helpers.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/api_trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/byte_buffer_reader.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_details.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/call_log_batch.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_init.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_ping.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/channel_stack_type.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/completion_queue_factory.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/event_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/lame_client.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/metadata_array.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/server.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/validate_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/surface/version.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/bdp_estimator.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/byte_stream.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/connectivity_state.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/error_utils.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/metadata_batch.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/pid_controller.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/service_config.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/static_metadata.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/status_conversion.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/timeout_encoding.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/transport/transport_op_string.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/lib/debug/trace.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/bin_decoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/bin_encoder.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_plugin.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/chttp2_transport.o
  CXX(target) Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.o
../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc: In member function ‘virtual uint32_t grpc_core::chttp2::TransportFlowControl::MaybeSendUpdate(bool)’:
../deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.cc:188:50: error: type qualifiers ignored on cast result type [-Werror=ignored-qualifiers]
  188 |       static_cast<const uint32_t>(target_window());
      |                                                  ^
cc1plus: all warnings being treated as errors
make[1]: *** [grpc.target.mk:407: Release/obj.target/grpc/deps/grpc/src/core/ext/transport/chttp2/transport/flow_control.o] Error 1
make[1]: Leaving directory '/home/mt/git/grafana-image-renderer.git/node_modules/grpc/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 5.3.12-300.fc31.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node" "--module_name=grpc_node" "--module_path=/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc" "--napi_version=5" "--node_abi_napi=napi"
gyp ERR! cwd /home/mt/git/grafana-image-renderer.git/node_modules/grpc
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc --napi_version=5 --node_abi_napi=napi' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/mt/git/grafana-image-renderer.git/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
node-pre-gyp ERR! System Linux 5.3.12-300.fc31.x86_64
node-pre-gyp ERR! command "/usr/bin/node" "/home/mt/git/grafana-image-renderer.git/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /home/mt/git/grafana-image-renderer.git/node_modules/grpc
node-pre-gyp ERR! node -v v12.13.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --library=static_library --module=/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc/grpc_node.node --module_name=grpc_node --module_path=/home/mt/git/grafana-image-renderer.git/node_modules/grpc/src/node/extension_binary/node-v72-linux-x64-glibc --napi_version=5 --node_abi_napi=napi' (1)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
make: *** [Makefile:14: node_modules] Error 1

Could you please advice how should I fix this issue with grpc?

Why don't you provide a pre-built tarball images at the plugin market?

Thanks!

Grafana returns 401 on direct image render link from the image renderer

What happened:
Following the instruction on https://grafana.com/docs/grafana/latest/administration/image_rendering/#remote-rendering-service . Image Renderer throws error on unauthorized access to grafana.

What you expected to happen: Image Renderer should be able to call grafana for direct rendered image

How to reproduce it (as minimally and precisely as possible):
Following the instruction on https://grafana.com/docs/grafana/latest/administration/image_rendering/#remote-rendering-service

Anything else we need to know?:

Environment:

  • Grafana Image Renderer version: latest
  • Grafana version: 6.5.3
  • Installed plugin or remote renderer service: As a service on a container
  • OS Grafana Image Renderer is installed on: container
  • User OS & Browser: Mac OS / Chrome
  • Others:
1/21/2020 4:48:04 PM{"level":"info","message":"Render request received', 'url', http://grafana:3000/d-solo/N4gOslEWk/grafana-alert-troubleshooting?orgId=1&panelId=2&render=1"}
1/21/2020 4:48:04 PM{"0":"msg","1":"Failed to load resource: the server responded with a status of 401 (Unauthorized)","2":"url","3":"http://grafana:3000/d-solo/N4gOslEWk/grafana-alert-troubleshooting?orgId=1&panelId=2&render=1","4":"line","6":"column","level":"error","message":"Browser console error"}

Unhandled Promise Rejection: Unknown Plugin type: renderer

Update:

I've actually got this working. It looks like I had a bunch of missing system libraries. Of note, I am on CentOS 7. Here's what got it working for me:

yum -y install libXcomposite libXtst cups-libs libXScrnSaver alsa-lib atk at-spi2-atk gtk3

Original:

Similar to #1, I cannot get the plugin to load properly. I am seeing this error in my browsers console:

Unhandled Promise Rejection: Unknown Plugin type: renderer

I am on a valid version of Grafana as far as I can tell, 6.4.1.

Screen Shot 2019-10-03 at 11 31 34 AM

Screen Shot 2019-10-03 at 11 31 43 AM

I did enable logging, but nothing stands out:

t=2019-10-03T11:30:33-0500 lvl=info msg="Renderer plugin found, starting" logger=rendering cmd=plugin_start_linux_amd64
t=2019-10-03T11:30:33-0500 lvl=dbug msg="starting plugin" logger=rendering path=/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64 args=[/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64]
t=2019-10-03T11:30:33-0500 lvl=dbug msg="plugin started" logger=rendering path=/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64 pid=24558
t=2019-10-03T11:30:33-0500 lvl=dbug msg="waiting for RPC address" logger=rendering path=/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64
t=2019-10-03T11:30:33-0500 lvl=info msg="Initializing Stream Manager"
t=2019-10-03T11:30:33-0500 lvl=info msg="HTTP Server Listen" logger=http.server address=127.0.0.1:3000 protocol=http subUrl= socket=
t=2019-10-03T11:30:34-0500 lvl=dbug msg="Renderer plugin started" logger=rendering
t=2019-10-03T11:30:34-0500 lvl=dbug msg="using plugin" logger=rendering version=1

Not sure where to go from here.

Exclude Buttons on Rendering

Is there a way to render image excluding the top part of the graph? I wish to only display the graph.

I know that there are ways to programmatically do this (like crop it using image libraries) but I wish to skip that part if possible.

Thanks.

Panels rendering timeout

Hello everyone,

I experienced some troubles with grafana image renderer (same troubles with PhantomJS renderer).
Some panels (like Clock, DrawIO, and some of my custom panels) are impossible to render (the timeout is always reached).

Some logs :
lvl=eror msg="Render request failed" logger=rendering url="http://localhost:3000/d-solo/ksSgva0Wz/main?orgId=1&from=1572495407183&to=1572500826087&panelId=27&width=1000&height=500&tz=Europe%2FParis&render=1" error=map[name:TimeoutError] timestamp=0001-01-01T00:00:00.000Z

Environment :

  • Grafana Image Renderer version : 1.0.7
  • Grafana version : 6.4.3
  • Installed plugin or remote renderer service : installed plugin
  • OS Grafana Image Renderer is installed on: Debian 9
  • User OS & Browser: Windows, Chrome

Do you know how can I fix that ?

Thanks

Allow specifying bind address via env variable

Hi,

I would like to have a GF_RENDERER_PLUGIN_BIND_ADDRESS env variable to define the host/port the renderer plugin is listening to.

My issue is that I have isolated grafana servers, with isolated users. With only one instance getting the port, I am seeing lots of permissiond denied because they write the files to other user's directories.

Use a pool of browsers to execute render requests

Currently a new chrome instance is launched for every render request, which introduces latency and the possibility of running out of memory if too many requests come in at once.

Originally this requirement was because there wasn't a way to set the timezone for a particular page in puppeteer, but that is now available: https://github.com/puppeteer/puppeteer/blob/v2.0.0/docs/api.md#pageemulatetimezonetimezoneid

I'd suggest using https://github.com/Vincit/tarn.js to manage the pool of puppeteer browser objects so that we can easily handle multiple requests by running up to pool.max chrome instances and queuing requests until an instance is available.

Implement support for PDF rendering

We need to add support for rendering panels and dashboards into PDF. Since image-renderer plugin uses puppeteer, it should be quite simple. I've made some initial research and found few pitfalls:

  • We have to set a proper width of the dashboard (in pixels), otherwise, panel legend overlaps graphs.
    Screenshot from 2019-08-01 13-10-10
  • We have to handle panels lazy loading (I think we can set a height of the browser viewport to the actual page height to show all panels) and make sure all queries are finished. This helps to avoid empty graphs. For this purpose we can use waitUntil: 'networkidle2' param:
    page.goto(options.url, { waitUntil: 'networkidle2' });
    
    Screenshot from 2019-08-01 13-14-35

Failing render because of timeout

Hi, I deployed the renderer as a stand alone server and tried rendering single panel which loads almost instantly but it times out in the renderer.

Not sure what causes this timeout and how I can resolve this? Can I configure it somewhere?

{ TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
    at Promise.then (/usr/src/app/node_modules/puppeteer/lib/NavigatorWatcher.js:74:21)
  stack:
   'TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded\n    at Promise.then (/usr/src/app/node_modules/puppeteer/lib/NavigatorWatcher.js:74:21)',
  message: 'Navigation Timeout Exceeded: 30000ms exceeded',
  name: 'TimeoutError',
  isBoom: true,
  isServer: true,
  data: null,
  output:
   { statusCode: 500,
     payload:
      { statusCode: 500,
        error: 'Internal Server Error',
        message: 'An internal server error occurred' },
     headers: {} },
  reformat: [Function],
  isDeveloperError: true }

Thanks for any info.

Missing dependency on boom

When running the installation instructions provided in the README, the compilation fails with the message

src/http-server.ts(5,23): error TS2307: Cannot find module 'boom'.

Running

yarn add boom
npm run build

seems to fix this.

Too many instances of grafana-image-renderer

Using this plugin to render scripted dashboards, which is working quite fine. However, today when I checked the running processes I found that there multiple instances of grafana-image-renderer running, is this a desired behaviour or am I missing some configuration?

grafana    692  0.0  0.2 1008844 53612 ?       Sl   May06   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana    833  0.0  0.1 983760 48908 ?        Sl   May06   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   1011  0.0  0.2 1010936 58060 ?       Sl   Apr29   0:02 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   1107  0.0  0.1 983744 48508 ?        Sl   Apr29   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   3643  0.0  0.1 984296 48380 ?        Sl   Apr26   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   4184  0.0  0.1 984272 48756 ?        Sl   May11   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   4327  0.0  0.1 983748 48228 ?        Sl   May11   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   4398  0.0  0.2 1008884 53268 ?       Sl   Apr26   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   5736  0.0  0.1 984296 48580 ?        Sl   May01   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   5829  0.0  0.1 984812 48852 ?        Sl   May01   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   6215  0.0  0.1 983724 48408 ?        Sl   May14   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   6258  0.0  0.1 983744 48580 ?        Sl   Apr28   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   6365  0.0  0.1 984256 48612 ?        Sl   May14   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   6402  0.0  0.2 1008852 51432 ?       Sl   Apr28   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   7363  0.0  0.1 984256 48916 ?        Sl   May20   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js
grafana   7512  0.0  0.2 1074380 51116 ?       Sl   May20   0:00 node /var/lib/grafana/plugins/grafana-image-renderer/build/app.js

malformed HTTP status code

Hi,

am I doing something wrong? Build and run it:
node app.js
1|1|tcp|0.0.0.0:50059|grpc
Renderer plugin started

Used direct link in Grafana and saw this in log:

t=2019-01-20T22:19:24+0100 lvl=eror msg="Failed to send request to remote rendering service." logger=rendering error="Get http://localhost:50059/render?domain=localhost&encoding=&height=500&renderKey=Ssd8i2Z5ryppUtjMeclxsIAsDMDoA8j2&timeout=60&timezone=Europe%2FBerlin&url=http%3A%2F%2Flocalhost%3A3000%2Fd-solo%2FC95vOQwmk%2Fnew-dashboard-copy%3ForgId%3D1%26panelId%3D2%26from%3D1547997538516%26to%3D1548019138516%26width%3D1000%26height%3D500%26tz%3DEurope%252FBerlin%26render%3D1&width=1000: net/http: HTTP/1.x transport connection broken: malformed HTTP status code "\x00\xfe\x03\x00\x00\x00\x01\x00\x00\x04\b\x00\x00\x00\x00\x00\x00?\x00\x01\x00\x00\b\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00""

t=2019-01-20T22:19:24+0100 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Failed to send request to remote rendering service. Get http://localhost:50059/render?domain=localhost&encoding=&height=500&renderKey=Ssd8i2Z5ryppUtjMeclxsIAsDMDoA8j2&timeout=60&timezone=Europe%2FBerlin&url=http%3A%2F%2Flocalhost%3A3000%2Fd-solo%2FC95vOQwmk%2Fnew-dashboard-copy%3ForgId%3D1%26panelId%3D2%26from%3D1547997538516%26to%3D1548019138516%26width%3D1000%26height%3D500%26tz%3DEurope%252FBerlin%26render%3D1&width=1000: net/http: HTTP/1.x transport connection broken: malformed HTTP status code "\x00\xfe\x03\x00\x00\x00\x01\x00\x00\x04\b\x00\x00\x00\x00\x00\x00?\x00\x01\x00\x00\b\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00""

t=2019-01-20T22:19:24+0100 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/C95vOQwmk/new-dashboard-copy status=500 remote_addr=[::1] time_ms=1 size=1722 referer="http://localhost:3000/d/C95vOQwmk/new-dashboard-copy?orgId=1"

Dependencies needed

On a minimal Centos install, the dependencies needed for grafana-image-renderer are not installed by default, and it's very difficult to establish exactly what RPMs need installing to allow the headless chrome to run.
Installing chrome from RPM pulled in the dependencies needed (listed below) but this should not be necessary. It's possible some of these are NOT needed when running headless too.

libXcomposite
libXdamage
libXtst
cups
libXScrnSaver
pango
atk
adwaita-cursor-theme
adwaita-icon-theme
at
at-spi2-atk
at-spi2-core
cairo-gobject
colord-libs
dconf
desktop-file-utils
ed
emacs-filesystem
gdk-pixbuf2
glib-networking
gnutls
gsettings-desktop-schemas
gtk-update-icon-cache
gtk3
hicolor-icon-theme
jasper-libs
json-glib
libappindicator-gtk3
libdbusmenu
libdbusmenu-gtk3
libepoxy
liberation-fonts
liberation-narrow-fonts
liberation-sans-fonts
liberation-serif-fonts
libgusb
libindicator-gtk3
libmodman
libproxy
libsoup
libwayland-cursor
libwayland-egl
libxkbcommon
m4
mailx
nettle
patch
psmisc
redhat-lsb-core
redhat-lsb-submod-security
rest
spax
time
trousers
xdg-utils
xkeyboard-config

arm64 fails to build

If I set make build_package ARCH=arm64 then I get error from Node.js that arm64 is unknown, but linux-arm64 is known. Then I invoked make build_package ARCH=linux-arm64 and somewhere the arm64 got eaten and it is parsed like linux-armv6. Then it says: Not able to build for 'armv6' here, only for 'arm64'.
OK, I understand, but how to tell him that I don't want armv6, rather arm64?

make build_package ARCH=linux-arm64
rm -rf build
./scripts/clean_target.sh linux-arm64
./node_modules/.bin/tsc
./scripts/package_target.sh linux-arm64

[email protected]
Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v10.4.1-linux-armv6 [ ] 1%
Error! 404 Not Found
https://github.com/zeit/pkg-fetch/releases/download/v2.5/uploaded-v2.5-node-v10.4.1-linux-armv6
Asset not found by direct link:
{"tag":"v2.5","name":"uploaded-v2.5-node-v10.4.1-linux-armv6"}
Not found in GitHub releases:
{"tag":"v2.5","name":"uploaded-v2.5-node-v10.4.1-linux-armv6"}
Building base binary from source:
built-v10.4.1-linux-armv6
Error! Not able to build for 'armv6' here, only for 'arm64'
child_process.js:656
throw err;
^

How to support https for grafana?

grafana use https, renderer use http.

monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59292: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59293: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | t=2019-11-02T09:47:28+0000 lvl=eror msg="Failed to look up user based on cookie" logger=context error="user token not found"
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59295: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59296: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59297: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59299: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:47:28 http: TLS handshake error from 10.255.0.2:59298: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | t=2019-11-02T09:47:46+0000 lvl=info msg="Successful Login" logger=http.server User=sandbox@localhost
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | 2019/11/02 09:49:01 http: TLS handshake error from 172.12.0.3:54474: remote error: tls: unknown certificate
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | t=2019-11-02T09:49:01+0000 lvl=eror msg="Remote rendering request failed" logger=rendering error="500 Internal Server Error"
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | t=2019-11-02T09:49:01+0000 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=sandbox error="Remote rendering request failed. 500: 500 Internal Server Error"
monitor_grafana-service.1.l9og2p9i456e@ubuntu1 | t=2019-11-02T09:49:01+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=sandbox method=GET path=/render/d-solo/e5Ef8jkmz/system status=500 remote_addr=10.255.0.2 time_ms=1990 size=1722 referer="https://10.103.238.31:3000/d/e5Ef8jkmz/system?orgId=1"

Did you fix it?

Feature Request: Allow setting CA file or CA path for the renderer

Referring to grafana/grafana#19842:

Currently there does not seem to be an option to make the renderer work with custom certificates on the Grafana server except configuring the plugin to ignore HTTPS errors altogether (e.g. by setting GF_RENDERER_PLUGIN_IGNORE_HTTPS_ERRORS=true in Grafana's environment at startup).

A much cleaner option would be a configuration that allows setting a custom CA for the server, preferably by pointing it to a CA directory, e.g. /etc/pki/tls/certs for RHELoid distributions, or to a specific CA file containing one or more trusted certificates, by a similar environment variable or the like.

Self signed certificates

I tested the render plugin against a Grafana instance with self signed certificate. I got the following error:
Error: net::ERR_CERT_COMMON_NAME_INVALID

Would be nice with a config parameter to trust unsigned certificates as that's probably the issue.

Rpm/deb packages

Hi,

Is there any chance to get rpm packages for this?

thanks!

Failed to load plugin json file: grafana-image-renderer/plugin.json, Unknown plugin type renderer

Hello,

I've been trying to get this plugin up and running and while the build phase went well, I'm hitting the following error during startup:

lvl=eror msg="Plugins: Failed to load plugin json file: /grafana-plugins/grafana-image-renderer/plugin.json, err: Unknown plugin type renderer"

Some more info:

What Grafana version are you using?

Grafana v5.1.3 (087143285)

What OS are you running grafana on?

Docker on Centos 7

Thanks in advance

Rendering fails on OpenSUSE

What happened:
Sharing any panel fails with "Rendering failed." error message.
The debug log:

Jan 21 17:24:13 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:13+0000 lvl=info msg="Renderer plugin found, starting" logger=rendering cmd=plugin_start_linux_amd64
Jan 21 17:24:13 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:13+0000 lvl=dbug msg="starting plugin" logger=rendering path=/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64 args=[/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64]
Jan 21 17:24:13 witek-tumbleweed systemd[1]: Started Grafana instance.
Jan 21 17:24:13 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:13+0000 lvl=dbug msg="plugin started" logger=rendering path=/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64 pid=1309
Jan 21 17:24:13 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:13+0000 lvl=dbug msg="waiting for RPC address" logger=rendering path=/var/lib/grafana/plugins/grafana-image-renderer/plugin_start_linux_amd64
Jan 21 17:24:13 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:13+0000 lvl=info msg="Initializing Stream Manager"
Jan 21 17:24:13 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:13+0000 lvl=info msg="HTTP Server Listen" logger=http.server address=[::]:3000 protocol=http subUrl= socket=
Jan 21 17:24:15 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:15+0000 lvl=dbug msg="using plugin" logger=rendering version=1
Jan 21 17:24:15 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:15+0000 lvl=info msg="Renderer plugin started" logger=rendering grpcHost=127.0.0.1 grpcPort=36691.000 chromeBin=/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome ignoreHTTPSErrors=false timestamp=0001-01-01T00:00:00.000Z
Jan 21 17:24:35 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:35+0000 lvl=dbug msg="Render request received" logger=rendering url="http://localhost:3000/d-solo/YvIS1OBZk/prometheus-2-0-stats?orgId=1&refresh=1m&from=1579623873757&to=1579627473757&panelId=14&width=1000&height=500&tz=Europe%2FBerlin&render=1" timestamp=0001-01-01T00:00:00.000Z
Jan 21 17:24:37 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:37+0000 lvl=eror msg="Render request failed" logger=rendering url="http://localhost:3000/d-solo/YvIS1OBZk/prometheus-2-0-stats?orgId=1&refresh=1m&from=1579623873757&to=1579627473757&panelId=14&width=1000&height=500&tz=Europe%2FBerlin&render=1" error="[object Object]" timestamp=0001-01-01T00:00:00.000Z
Jan 21 17:24:37 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:37+0000 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: [object Object]"
Jan 21 17:24:37 witek-tumbleweed grafana-server[1286]: t=2020-01-21T17:24:37+0000 lvl=eror msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d-solo/YvIS1OBZk/prometheus-2-0-stats status=500 remote_addr=10.163.8.161 time_ms=2293 size=1722 referer="http://10.86.3.136:3000/d/YvIS1OBZk/prometheus-2-0-stats?orgId=1&refresh=1m"

What you expected to happen:

How to reproduce it (as minimally and precisely as possible):

  • Choose Prometheus Scrape Duration panel
  • Share
  • Choose Direct link rendered image

Anything else we need to know?:

Environment:

  • Grafana Image Renderer version: 1.0.8
  • Grafana version: 6.4.5 or 6.5.3
  • Installed plugin or remote renderer service: installed plugin
  • OS Grafana Image Renderer is installed on: OpenSUSE Linux Tumbleweed
  • User OS & Browser: Firefox 68.4.1esr
  • Others:

Cannot set custom port

Hi there,

I am running Grafana inside Docker container and installing grafana-image-renderer as a plugin. I want to set custom port (other than 8081) for renderer to listen to.
Is this possible?

Thank you and regards

Docker image segmentation fault on some T3 EC2 instance types

What happened:

Starting the container fails silently:

sudo docker run --rm -it -p 127.0.0.1:8081:8081 grafana/grafana-image-renderer:1.0.7

Or, more usefully:

sudo docker run --rm -it -p 127.0.0.1:8081:8081 grafana/grafana-image-renderer:1.0.7 sh
/usr/src/app # npm start

> [email protected] start /usr/src/app
> node build/app.js

Segmentation fault (core dumped)

What you expected to happen:

I expected it to run. On a different platform (t3a - the AMD based one) I get:

sudo docker run --rm -it -p 127.0.0.1:8081:8081 grafana/grafana-image-renderer:1.0.7
Using chromeBin /usr/bin/chromium-browser
HTTP Server started, listening on 8081

How to reproduce it (as minimally and precisely as possible):

  1. Start an EC2 t3.micro instance (not t3a.micro)
  2. Install Docker:
#!/usr/bin/env bash

DOCKER_VERSION='19.03.4~3-0~ubuntu-bionic'
DOCKER_SHA256='31ee4b40cc6b76966318e007a1c7cedd64c6a3dd957de1de40734eb06320b8d3'

set -e
echo "Installing Docker"

export DEBIAN_FRONTEND=noninteractive

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

sudo apt-key fingerprint 0EBFCD88

if [[ ! $(sudo apt-key fingerprint 0EBFCD88) ]]; then
    echo 'Could not verify Docker GPG key'
    exit 1
fi

sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install -y docker-ce
  1. Run this Docker image:
sudo docker run --rm -it -p 127.0.0.1:8081:8081 grafana/grafana-image-renderer:1.0.7

Anything else we need to know?:

Running a shell in the image and then launching the application under strace ends with this:

...
mprotect(0xddbb7984000, 503808, PROT_READ|PROT_WRITE) = 0
mprotect(0xddbb7984000, 503808, PROT_READ|PROT_EXEC) = 0
statx(AT_FDCWD, "/usr/src/app/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node", AT_STATX_SYNC_AS_STAT, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFREG|0755, stx_size=8587672, ...}) = 0
statx(AT_FDCWD, "/usr/src/app/node_modules/grpc/src/node", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/usr/src/app/node_modules/grpc/src/node/extension_binary", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/usr/src/app/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFDIR|0755, stx_size=4096, ...}) = 0
statx(AT_FDCWD, "/usr/src/app/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_ALL, {stx_mask=STATX_ALL, stx_attributes=0, stx_mode=S_IFREG|0755, stx_size=8587672, ...}) = 0
open("/usr/src/app/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-musl/grpc_node.node", O_RDONLY|O_CLOEXEC) = 20
fcntl(20, F_SETFD, FD_CLOEXEC)          = 0
fstat(20, {st_mode=S_IFREG|0755, st_size=8587672, ...}) = 0
read(20, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\31\1\0\0\0\0\0"..., 960) = 960
mmap(NULL, 3137536, PROT_READ|PROT_EXEC, MAP_PRIVATE, 20, 0) = 0x7f8e72788000
mmap(0x7f8e72a7b000, 45056, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 20, 0xf3000) = 0x7f8e72a7b000
mmap(0x7f8e72a82000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f8e72a82000
close(20)                               = 0
mprotect(0x7f8e72a7b000, 16384, PROT_READ) = 0
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], [], 8) = 0
membarrier(MEMBARRIER_CMD_PRIVATE_EXPEDITED, 0) = -1 EPERM (Operation not permitted)
rt_sigprocmask(SIG_BLOCK, ~[RTMIN RT_1 RT_2], ~[KILL STOP RTMIN RT_1 RT_2], 8) = 0
rt_sigaction(SIGRT_2, {sa_handler=0x7f8e75464745, sa_mask=~[], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f8e7548a28f}, NULL, 8) = 0
tkill(56, SIGRT_2)                      = 0
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)

It looks like the membarrier call triggers the segmentation fault? Perhaps there some flag on Docker that needs to be set or some incompatibility with the kernel/CPU?

Environment:

  • Grafana Image Renderer version: 1.0.7
  • Grafana version: n/a (but intend to use it with 6.5.1)
  • Installed plugin or remote renderer service: Remote render service
  • OS Grafana Image Renderer is installed on: As per the Dockerfile in the repo
  • User OS & Browser: Ubuntu 18.04 (Linux ip-172-30-10-202 4.15.0-1051-aws #53-Ubuntu SMP Wed Sep 18 13:35:53 UTC 2019 x86_64 GNU/Linux)
  • Others:

Does not work when IPv6 is disabled

Is this plugin trying to bind to "[::]" ?

Because we disable IPv6 in the kernel to avoid a certain class of problems, and the plugin refuses to start with this message:
E1023 17:01:02.999153762 20891 server_chttp2.cc:38] {"created":"@1571842862.999100646","description":"No address added out of total 1 resolved","file":"../deps/grpc/src/core/ext/transport/chttp2/server/chttp2_server.cc","file_line":305,"referenced_errors":[{"created":"@1571842862.999093903","description":"Failed to add port to server","file":"../deps/grpc/src/core/lib/iomgr/tcp_server_uv.cc","file_line":436,"referenced_errors":[{"created":"@1571842862.999087065","description":"Failed to initialize UV tcp handle","file":"../deps/grpc/src/core/lib/iomgr/tcp_server_uv.cc","file_line":277,"os_error":"address family not supported"}]}]}

Add support for ARM

Hey,

is there any plans to support arm CPUs?

I'am using a Synology DS216play with a STM STiH412 CPU.
When i want to install the image rendering, yarn throw me these errors:
yarn log.txt
with Google i found out that node grpc supports arm after Version 1.4.1.

Or is there a way to Cross Compile it?

Thank you

Grafana panel alert details cause failure

Configured the grafana-image-renderer as a docker container with a sneaky datasource configuration problem that only affected the renderer, then tried to render an image

What happened:

Got a generic error message displayed in Grafana directing to logs for more info. Renderer logged a timeout error in waitForFunction() with no additional information.

What you expected to happen:

Expected either a) the Grafana data-retrieval error would be logged (which it wasn't) or b) the data-retrieval error that it rendered in the browser would be returned as a browser screenshot by the renderer.

How to reproduce it (as minimally and precisely as possible):

Define a Prometheus datasource in Grafana with the following characteristics:

  • Configured to have the browser load the data rather than having Grafana proxy
  • Use a hostname that can be resolved by the end user's browser, but not by containers in the docker host
  • Try to have Grafana render an image of a panel based on that Prometheus datasource

Anything else we need to know?:

Changing browser.ts starting on line 66 as below allows the renderer to send back a screenshot of Grafana's error message, which allows troubleshooting to continue:

      // wait for all panels (or any alert panel) to render.
      await page.waitForFunction(
        () => {
          const panelCount = document.querySelectorAll('.panel').length || document.querySelectorAll('.panel-container').length;
          return ((window as any).panelsRendered >= panelCount) || (document.querySelectorAll('.alert').length > 0);
        },
        {
          timeout: options.timeout * 1000,
        }
      );

Environment:

  • Grafana Image Renderer version:
  • Grafana version:
  • Installed plugin or remote renderer service:
  • OS Grafana Image Renderer is installed on:
  • User OS & Browser:
  • Others:

How to get png image thourgh grafana-image-renderer?

I'm a freshman of grafana and I am trying to get the panel image in png format from remote server.
I have unzipped and downloaded plugin-linux-x64-glibc.zip in grafna plugins path.
However, I still have no idea how to use grafana-image-renderer so as to get the png in remote sever.
Can someone give any advice or tutorials?

Rendering failed

Hi,

I get the following:
EROR[05-23|09:51:35] Rendering failed. logger=context userId=72 orgId=1 uname=theo error="Failed to send request to remote rendering service. Get http://myserver.localdomain:8081/render?domain=localdomain&encoding=&height=6000&renderKey=fTozC8NQnHQYEoJVbh1QFkPQaCMVVu0E&timeout=3000&timezone=&url=https%3A%2F%2Flocaldomain%3A8033%2Fdashboard%2Fdb%2Fdevice-dashboard-5-min-samples-copy%3ForgId%3D1%26theme%3Dlight%26width%3D2500%26height%3D6000%26timeout%3D3000%26render%3D1&width=2500: net/http: HTTP/1.x transport connection broken: malformed HTTP status code "\x00\xfe\x03\x00\x00\x00\x01\x00\x00\x04\b\x00\x00\x00\x00\x00\x00?\x00\x01\x00\x00\b\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00""
EROR[05-23|09:51:35] Request Completed logger=context userId=72 orgId=1 uname=theo method=GET path=/render/dashboard/db/device-dashboard-5-min-samples-copy status=500 remote_addr=192.168.10.2 time_ms=8 size=1722 referer="https://myserver.localdomain:8033/d/g9s4FbWZk/device-dashboard-5-min-samples-copy?orgId=1"

I placed the plugin in the grafana plugins directory, however it does not start automatically. I started it as folllows:
$ ./plugin_start_linux_amd64
1|1|tcp|127.0.0.1l:8081|grpc
Renderer plugin started

I had to adjust the port in grpc-plugin.js, otherwise it defaults to port 50059

Platform: RHEL7
NodeJS: v10.14.1

How do I fix this?
/Theo

Width and Height ignored - dashboard renders at 800x400

Hello

I'm trying to render complete dashboard with 1.0.7 plugin. I use URL:
https://HOSTNAME/render/d/Wnpn7rtZk/DASHBOARDNAME&width=1920&height=1080&autofitpanels
and get only so small PNG. Looks like the width and height are being ignored.
image
The plugin is installed directly on the grafana instance. There is very limited gui on SLES installed that I can use from Vcenter. The login screen is 800x600. Log files consist only with:
t=2019-12-20T11:41:36+0100 lvl=dbug msg="Render request received" logger=rendering url="https://localhost:443/d/Wnpn7rtZk/DashboardName&width=1920&height=1080?&render=1" timestamp=0001-01-01T00:00:00.00
Does chrome open connection to existing x11 to make a png? Or it is working on its own?

Rendering not waiting for panel to load

Is there a way to set a time to wait for the panel to load? I'm having problems with several dashboards that are been render before the panels in them are ready (with data).
So I end up with an image of several panels been loaded.

Installing and running plugin in Grafana docker container doesn't work

Rendering is not working on a fresh docker 'install' of Grafana 6.4.1 with grafana-image-renderer 1.0.5:

installing grafana-image-renderer @ 1.0.5
from: https://grafana.com/api/plugins/grafana-image-renderer/versions/1.0.5/download
into: /var/lib/grafana/plugins

✔ Installed grafana-image-renderer successfully 

...

t=2019-10-04T00:34:01+0000 lvl=eror msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: Failed to launch chrome!\n/var/lib/grafana/plugins/grafana-image-renderer/chrome-linux/chrome: error while loading shared libraries: libX11.so.6: cannot open shared object file: No such file or directory\n\n\nTROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md\n"

Installed/ran via docker as such:

docker run \
  -d \
  --user $(id -u) \
  --volume "$PWD/data:/var/lib/grafana" \
  -p 9001:3000 \
  --name=test-641 \
  -e "GF_INSTALL_PLUGINS=grafana-image-renderer,grafana-piechart-panel,grafana-worldmap-panel" \
  grafana/grafana:6.4.1

Cannot show Chinese characers

Use latest.

Cannot show chinese character like "你好" in pic generated by http://grafana/render/db/dashoboard url

Improve debug messages

What would you like to be added:
Capure requests and console messages in headless chrome and log them.

Why is this needed:
To make it easier for users to debug issues when rendering doesn't work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.