Image rendering

SmartCollect SC² supports automatic rendering of panels and dashboards as PNG images. This allows SmartCollect SC² to automatically generate images of your panels to include in alert notifications.

While an image is being rendered, the PNG image is temporarily written to the file system. When the image is rendered, the PNG image is temporarily written to the png folder in the SmartCollect SC² data folder.

A background job runs every 10 minutes and removes temporary images. You can configure how long an image should be stored before being removed by configuring the temp-data-lifetime setting.

You can also render a PNG by clicking the dropdown arrow next to a panel title, then clicking Share > Direct link rendered image.

Memory requirements

Minimum free memory recommendation is 16GB on the system doing the rendering.

Rendering images can require a lot of memory, mainly because SmartCollect SC² creates browser instances in the background for the actual rendering. If multiple images are rendered in parallel, then the rendering has a bigger memory footprint. One advantage of using the remote rendering service is that the rendering will be done on the remote system, so your local system resources will not be affected by rendering.

Alerting and render limits

Alert notifications can include images, but rendering many images at the same time can overload the server where the renderer is running. For instructions of how to configure this, see concurrent_render_limit.

PhantomJS

Starting from SmartCollect SC² v7.0.0, all PhantomJS support has been removed. Please use the SmartCollect SC² Image rendering module.

Troubleshoot image rendering

Enable debug log messages for rendering in the SmartCollect SC² configuration file and inspect the SmartCollect SC² server log.

[log]
filters = rendering:debug

Certificate signed by internal certificate authorities

In many cases, SmartCollect SC² runs on internal servers and uses certificates that have not been signed by a CA (Certificate Authority) known to Chrome, and therefore cannot be validated. Chrome internally uses NSS (Network Security Services) for cryptographic operations such as the validation of certificates.

If you are using the SmartCollect SC² Image Renderer with a SmartCollect SC² server that uses a certificate signed by such a custom CA (for example a company-internal CA), rendering images will fail and you will see messages like this in the SmartCollect SC² log:

t=2019-12-04T12:39:22+0000 lvl=error msg="Render request failed" logger=rendering error=map[] url="https://192.168.106.101:443/d/zxYJxNaZk/mysql-metrics?orgId=1&refresh=1m&from=1575438321300&to=1575459921300&var-Host=master1&panelId=4&width=1000&height=500&tz=Europe%2FBerlin&render=1" timestamp=0001-01-01T00:00:00.000Z
t=2019-12-04T12:39:22+0000 lvl=error msg="Rendering failed." logger=context userId=1 orgId=1 uname=admin error="Rendering failed: Error: net::ERR_CERT_AUTHORITY_INVALID at https://192.168.106.101:443/d/zxYJxNaZk/mysql-metrics?orgId=1&refresh=1m&from=1575438321300&to=1575459921300&var-Host=master1&panelId=4&width=1000&height=500&tz=Europe%2FBerlin&render=1"
t=2019-12-04T12:39:22+0000 lvl=error msg="Request Completed" logger=context userId=1 orgId=1 uname=admin method=GET path=/render/d/zxYJxNaZk/mysql-metrics status=500 remote_addr=192.168.106.101 time_ms=310 size=1722 referer="https://smartcollect.xxx-xxx/d/zxYJxNaZk/mysql-metrics?orgId=1&refresh=1m"

(The severity-level error in the above messages might be misspelled with a single r)

If this happens, then you have to add the certificate to the trust store. If you have the certificate file for the internal root CA in the file internal-root-ca.crt.pem, then use these commands to create a user specific NSS trust store for the SmartCollect SC² user (smartcollect for the purpose of this example) and execute the following steps:

[root@merver ~]# certutil -d sql:/usr/share/smartcollect/.pki/nssdb -A -n internal-root-ca -t C -i /etc/pki/tls/certs/internal-root-ca.crt.pem
[root@server ~]# chown -R smartcollect: /usr/share/smartcollect/.pki/nssdb