grafana/docs/sources/setup-grafana/image-rendering/_index.md

523 lines
15 KiB
Markdown
Raw Normal View History

---
aliases:
- ../administration/image_rendering/
- ../image-rendering/
description: Image rendering
keywords:
- grafana
- image
- rendering
- plugin
Explicitly set all front matter labels in the source files (#71548) * Set every page to have defaults of 'Enterprise' and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration pages to have of 'Cloud', 'Enterprise', and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/enterprise-licensing pages to have 'Enterprise' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/organization-management pages to have 'Enterprise' and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/provisioning pages to have 'Enterprise' and 'Open source' labels Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/recorded-queries pages to have labels cloud,enterprise * Set administration/roles-and-permissions/access-control pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set administration/stats-and-license pages to have labels cloud,enterprise * Set alerting pages to have labels cloud,enterprise,oss * Set breaking-changes pages to have labels cloud,enterprise,oss * Set dashboards pages to have labels cloud,enterprise,oss * Set datasources pages to have labels cloud,enterprise,oss * Set explore pages to have labels cloud,enterprise,oss * Set fundamentals pages to have labels cloud,enterprise,oss * Set introduction/grafana-cloud pages to have labels cloud Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix introduction pages products Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set panels-visualizations pages to have labels cloud,enterprise,oss * Set release-notes pages to have labels cloud,enterprise,oss * Set search pages to have labels cloud,enterprise,oss * Set setup-grafana/configure-security/audit-grafana pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set setup-grafana/configure-security/configure-authentication pages to have labels cloud,enterprise,oss * Set setup-grafana/configure-security/configure-authentication/enhanced-ldap pages to have labels cloud,enterprise * Set setup-grafana/configure-security/configure-authentication/saml pages to have labels cloud,enterprise * Set setup-grafana/configure-security/configure-database-encryption/encrypt-secrets-using-hashicorp-key-vault pages to have labels cloud,enterprise * Set setup-grafana/configure-security/configure-request-security pages to have labels cloud,enterprise,oss Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set setup-grafana/configure-security/configure-team-sync pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set setup-grafana/configure-security/export-logs pages to have labels cloud,enterprise Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Set troubleshooting pages to have labels cloud,enterprise,oss * Set whatsnew pages to have labels cloud,enterprise,oss * Apply updated labels from review Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com> --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> Co-authored-by: Isabel <76437239+imatwawana@users.noreply.github.com>
2023-07-18 03:10:12 -05:00
labels:
products:
- enterprise
- oss
title: Set up image rendering
weight: 1000
---
# Set up image rendering
Grafana supports automatic rendering of panels as PNG images. This allows Grafana to automatically generate images of your panels to include in alert notifications, [PDF export]({{< relref "../../dashboards/create-reports#export-dashboard-as-pdf" >}}), and [Reporting]({{< relref "../../dashboards/create-reports" >}}). PDF Export and Reporting are available only in [Grafana Enterprise]({{< relref "../../introduction/grafana-enterprise" >}}) and [Grafana Cloud](/docs/grafana-cloud/).
> **Note:** Image rendering of dashboards is not supported at this time.
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 Grafana `data` folder.
Enable doc-validator for specific directories (#63524) * Enable doc-validator for specific directories Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix one linting error to trigger CI Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to latest release Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator version from CI in local make target Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Revert to 1.11.0 Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * adds missing descriptions * Fix titles and headings Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix link formats Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix easy to resolve anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove broken anchor link This anchor appears to have been broken for a long time. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator image with support for numbered anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure to support doc-validator 2.0.x Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix a bunch of broken anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Ignore old whatsnew content Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to v2.0.x and use reviewdog to report errors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * removes broken links --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-05-18 09:50:20 -05:00
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]({{< relref "../configure-grafana#temp_data_lifetime" >}}) setting.
Update _index.md (#72068) * Update _index.md Edits to the "Set up image rendering" doc. 1. First section, "Set up Image Rendering," last paragraph: "You can also render a PNG by clicking hovering..." -- I removed "clicking" from that sentence. 2. "Alerting and Render Limits" section, link for "concurrent_render_limit" takes you to the page but not the section. This seems to be the case for all section links on this "Configure Grafana" page. I'm not sure how to fix it but switched from a relative link to a full path to see if that would help. 3. "Install Grafana Image Renderer Plugin," the link goes to the plugin overview page instead of the installation page. I tried adding the full path to see if that would go to the installation tab. 4. "Configuration" section, the same as the second edit I made, the first link, "Grafana configuration file," goes to the page but not the section link. I switched the relative path to a full path to see if it would work. 5. "Security" section, the very last sentence has the same Grafana configuration page link that goes to the correct page but not the correct section, "Grafana configuration" for the renderer token section. Same as previous ones, I switched out the relative path for the full path. 6. "Start browser with additional arguments," the second link in the first paragraph that goes to Puppeteer list of Chromium flags went to a 404 page. I couldn't figure out where they had moved it so I found a different site with a list of default flags and used that link instead. * corrects links * updates links * fixes anchor link --------- Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-07-21 12:23:32 -05:00
You can also render a PNG by hovering over the panel to display the actions menu in the top right corner, and then clicking **Share > Direct link rendered image** in the Link tab.
## 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 [max_concurrent_screenshots]({{< relref "../configure-grafana#max_concurrent_screenshots" >}}).
## Install Grafana Image Renderer plugin
{{% admonition type="note" %}}
Starting from Grafana v7.0.0, all PhantomJS support has been removed. Please use the Grafana Image Renderer plugin or remote rendering service.
{{% /admonition %}}
Update _index.md (#72068) * Update _index.md Edits to the "Set up image rendering" doc. 1. First section, "Set up Image Rendering," last paragraph: "You can also render a PNG by clicking hovering..." -- I removed "clicking" from that sentence. 2. "Alerting and Render Limits" section, link for "concurrent_render_limit" takes you to the page but not the section. This seems to be the case for all section links on this "Configure Grafana" page. I'm not sure how to fix it but switched from a relative link to a full path to see if that would help. 3. "Install Grafana Image Renderer Plugin," the link goes to the plugin overview page instead of the installation page. I tried adding the full path to see if that would go to the installation tab. 4. "Configuration" section, the same as the second edit I made, the first link, "Grafana configuration file," goes to the page but not the section link. I switched the relative path to a full path to see if it would work. 5. "Security" section, the very last sentence has the same Grafana configuration page link that goes to the correct page but not the correct section, "Grafana configuration" for the renderer token section. Same as previous ones, I switched out the relative path for the full path. 6. "Start browser with additional arguments," the second link in the first paragraph that goes to Puppeteer list of Chromium flags went to a 404 page. I couldn't figure out where they had moved it so I found a different site with a list of default flags and used that link instead. * corrects links * updates links * fixes anchor link --------- Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-07-21 12:23:32 -05:00
To install the plugin, refer to the [Grafana Image Renderer Installation instructions](/grafana/plugins/grafana-image-renderer/?tab=installation#installation).
## Configuration
The Grafana Image Renderer plugin has a number of configuration options that are used in plugin or remote rendering modes.
Enable doc-validator for specific directories (#63524) * Enable doc-validator for specific directories Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix one linting error to trigger CI Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to latest release Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator version from CI in local make target Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Revert to 1.11.0 Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * adds missing descriptions * Fix titles and headings Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix link formats Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix easy to resolve anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove broken anchor link This anchor appears to have been broken for a long time. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator image with support for numbered anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure to support doc-validator 2.0.x Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix a bunch of broken anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Ignore old whatsnew content Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to v2.0.x and use reviewdog to report errors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * removes broken links --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-05-18 09:50:20 -05:00
In plugin mode, you can specify them directly in the [Grafana configuration file]({{< relref "../configure-grafana#plugingrafana-image-renderer" >}}).
In remote rendering mode, you can specify them in a `.json` [configuration file](#configuration-file) or, for some of them, you can override the configuration defaults using environment variables.
### Configuration file
You can update your settings by using a configuration file, see [default.json](https://github.com/grafana/grafana-image-renderer/tree/master/default.json) for defaults. Note that any configured environment variable takes precedence over configuration file settings.
You can volume mount your custom configuration file when starting the docker container:
```bash
docker run -d --name=renderer --network=host -v /some/path/config.json:/usr/src/app/config.json grafana/grafana-image-renderer:latest
```
You can see a docker-compose example using a custom configuration file [here](https://github.com/grafana/grafana-image-renderer/tree/master/devenv/docker/custom-config).
### Security
{{% admonition type="note" %}}
This feature is available in Image Renderer v3.6.1 and later.
{{% /admonition %}}
You can restrict access to the rendering endpoint by specifying a secret token. The 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.
Renderer versions v3.6.1 or later require a Grafana version with this feature. These include:
- Grafana v9.1.2 or later
- Grafana v9.0.8 or later patch releases
- Grafana v8.5.11 or later patch releases
- Grafana v8.4.11 or later patch releases
- Grafana v8.3.11 or later patch releases
```bash
AUTH_TOKEN=-
```
```json
{
"security": {
"authToken": "-"
}
}
```
Update _index.md (#72068) * Update _index.md Edits to the "Set up image rendering" doc. 1. First section, "Set up Image Rendering," last paragraph: "You can also render a PNG by clicking hovering..." -- I removed "clicking" from that sentence. 2. "Alerting and Render Limits" section, link for "concurrent_render_limit" takes you to the page but not the section. This seems to be the case for all section links on this "Configure Grafana" page. I'm not sure how to fix it but switched from a relative link to a full path to see if that would help. 3. "Install Grafana Image Renderer Plugin," the link goes to the plugin overview page instead of the installation page. I tried adding the full path to see if that would go to the installation tab. 4. "Configuration" section, the same as the second edit I made, the first link, "Grafana configuration file," goes to the page but not the section link. I switched the relative path to a full path to see if it would work. 5. "Security" section, the very last sentence has the same Grafana configuration page link that goes to the correct page but not the correct section, "Grafana configuration" for the renderer token section. Same as previous ones, I switched out the relative path for the full path. 6. "Start browser with additional arguments," the second link in the first paragraph that goes to Puppeteer list of Chromium flags went to a 404 page. I couldn't figure out where they had moved it so I found a different site with a list of default flags and used that link instead. * corrects links * updates links * fixes anchor link --------- Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-07-21 12:23:32 -05:00
See [Grafana configuration]({{< relref "../configure-grafana#renderer_token" >}}) for how to configure the token in Grafana.
### Rendering mode
You can instruct how headless browser instances are created by configuring a rendering mode. Default is `default`, other supported values are `clustered` and `reusable`.
#### Default
Default mode will create a new browser instance on each request. When handling multiple concurrent requests, this mode increases memory usage as it will launch multiple browsers at the same time. If you want to set a maximum number of browser to open, you'll need to use the [clustered mode](#clustered).
{{% admonition type="note" %}}
When using the `default` mode, it's recommended to not remove the default Chromium flag `--disable-gpu`. When receiving a lot of concurrent requests, not using this flag can cause Puppeteer `newPage` function to freeze, causing request timeouts and leaving browsers open.
{{% /admonition %}}
```bash
RENDERING_MODE=default
```
```json
{
"rendering": {
"mode": "default"
}
}
```
#### Clustered
With the `clustered` mode, you can configure how many browser instances or incognito pages can execute concurrently. Default is `browser` and will ensure a maximum amount of browser instances can execute concurrently. Mode `context` will ensure a maximum amount of incognito pages can execute concurrently. You can also configure the maximum concurrency allowed, which per default is `5`, and the maximum duration of a rendering request, which per default is `30` seconds.
Using a cluster of incognito pages is more performant and consumes less CPU and memory than a cluster of browsers. However, if one page crashes it can bring down the entire browser with it (making all the rendering requests happening at the same time fail). Also, each page isn't guaranteed to be totally clean (cookies and storage might bleed-through as seen [here](https://bugs.chromium.org/p/chromium/issues/detail?id=754576)).
```bash
RENDERING_MODE=clustered
RENDERING_CLUSTERING_MODE=browser
RENDERING_CLUSTERING_MAX_CONCURRENCY=5
RENDERING_CLUSTERING_TIMEOUT=30
```
```json
{
"rendering": {
"mode": "clustered",
"clustering": {
"mode": "browser",
"maxConcurrency": 5,
"timeout": 30
}
}
}
```
#### Reusable (experimental)
When using the rendering mode `reusable`, one browser instance will be created and reused. A new incognito page will be opened for each request. This mode is experimental since, if the browser instance crashes, it will not automatically be restarted. You can achieve a similar behavior using `clustered` mode with a high `maxConcurrency` setting.
```bash
RENDERING_MODE=reusable
```
```json
{
"rendering": {
"mode": "reusable"
}
}
```
#### Optimize the performance, CPU and memory usage of the image renderer
Enable doc-validator for specific directories (#63524) * Enable doc-validator for specific directories Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix one linting error to trigger CI Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to latest release Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator version from CI in local make target Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Revert to 1.11.0 Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * adds missing descriptions * Fix titles and headings Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix link formats Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix easy to resolve anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove broken anchor link This anchor appears to have been broken for a long time. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator image with support for numbered anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure to support doc-validator 2.0.x Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix a bunch of broken anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Ignore old whatsnew content Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to v2.0.x and use reviewdog to report errors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * removes broken links --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-05-18 09:50:20 -05:00
The performance and resources consumption of the different modes depend a lot on the number of concurrent requests your service is handling. To understand how many concurrent requests your service is handling, [monitor your image renderer service]({{< relref "./monitoring" >}}).
With no concurrent requests, the different modes show very similar performance and CPU / memory usage.
When handling concurrent requests, we see the following trends:
- To improve performance and reduce CPU and memory consumption, use [clustered](#clustered) mode with `RENDERING_CLUSTERING_MODE` set as `context`. This parallelizes incognito pages instead of browsers.
- If you use the [clustered](#clustered) mode with a `maxConcurrency` setting below your average number of concurrent requests, performance will drop as the rendering requests will need to wait for the other to finish before getting access to an incognito page / browser.
To achieve better performance, monitor the machine on which your service is running. If you don't have enough memory and / or CPU, every rendering step will be slower than usual, increasing the duration of every rendering request.
### Other available settings
{{% admonition type="note" %}}
Please note that not all settings are available using environment variables. If there is no example using environment variable below, it means that you need to update the configuration file.
{{% /admonition %}}
#### HTTP host
Change the listening host of the HTTP server. Default is unset and will use the local host.
```bash
HTTP_HOST=localhost
```
```json
{
"service": {
"host": "localhost"
}
}
```
#### HTTP port
Change the listening port of the HTTP server. Default is `8081`. Setting `0` will automatically assign a port not in use.
```bash
HTTP_PORT=0
```
```json
{
"service": {
"port": 0
}
}
```
#### Enable Prometheus metrics
Enable doc-validator for specific directories (#63524) * Enable doc-validator for specific directories Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix one linting error to trigger CI Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to latest release Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator version from CI in local make target Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Revert to 1.11.0 Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * adds missing descriptions * Fix titles and headings Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix link formats Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix easy to resolve anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Remove broken anchor link This anchor appears to have been broken for a long time. Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Use doc-validator image with support for numbered anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update make-docs procedure to support doc-validator 2.0.x Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Fix a bunch of broken anchors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Ignore old whatsnew content Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * Update doc-validator to v2.0.x and use reviewdog to report errors Signed-off-by: Jack Baldry <jack.baldry@grafana.com> * removes broken links --------- Signed-off-by: Jack Baldry <jack.baldry@grafana.com> Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-05-18 09:50:20 -05:00
You can enable [Prometheus](https://prometheus.io/) metrics endpoint `/metrics` using the environment variable `ENABLE_METRICS`. Node.js and render request duration metrics are included, see [Enable Prometheus metrics endpoint]({{< relref "./monitoring#enable-prometheus-metrics-endpoint" >}}) for details.
Default is `false`.
```bash
ENABLE_METRICS=true
```
```json
{
"service": {
"metrics": {
"enabled": true,
"collectDefaultMetrics": true,
"requestDurationBuckets": [1, 5, 7, 9, 11, 13, 15, 20, 30]
}
}
}
```
#### Enable detailed timing metrics
With the [Prometheus metrics enabled](#enable-prometheus-metrics), you can also enable detailed metrics to get the duration of every rendering step.
Default is `false`.
```bash
# Available from v3.9.0+
RENDERING_TIMING_METRICS=true
```
```json
{
"rendering": {
"timingMetrics": true
}
}
```
#### Log level
Change the log level. Default is `info` and will include log messages with level `error`, `warning` and `info`.
```bash
LOG_LEVEL=debug
```
```json
{
"service": {
"logging": {
"level": "debug",
"console": {
"json": false,
"colorize": true
}
}
}
}
```
#### Verbose logging
Instruct headless browser instance whether to capture and log verbose information when rendering an image. Default is `false` and will only capture and log error messages. When enabled (`true`) debug messages are captured and logged as well.
Note that you need to change log level to `debug`, see above, for the verbose information to be included in the logs.
```bash
RENDERING_VERBOSE_LOGGING=true
```
```json
{
"rendering": {
"verboseLogging": true
}
}
```
#### Capture browser output
Instruct headless browser instance whether to output its debug and error messages into running process of remote rendering service. Default is `false`.
This can be useful to enable (`true`) when troubleshooting.
```bash
RENDERING_DUMPIO=true
```
```json
{
"rendering": {
"dumpio": true
}
}
```
#### Custom Chrome/Chromium
If you already have [Chrome](https://www.google.com/chrome/) or [Chromium](https://www.chromium.org/)
installed on your system, then you can use this instead of the pre-packaged version of Chromium.
{{% admonition type="note" %}}
Please note that this is not recommended, since you may encounter problems if the installed version of Chrome/Chromium is not compatible with the [Grafana Image renderer plugin](/grafana/plugins/grafana-image-renderer).
{{% /admonition %}}
You need to make sure that the Chrome/Chromium executable is available for the Grafana/image rendering service process.
```bash
CHROME_BIN="/usr/bin/chromium-browser"
```
```json
{
"rendering": {
"chromeBin": "/usr/bin/chromium-browser"
}
}
```
#### Start browser with additional arguments
Update _index.md (#72068) * Update _index.md Edits to the "Set up image rendering" doc. 1. First section, "Set up Image Rendering," last paragraph: "You can also render a PNG by clicking hovering..." -- I removed "clicking" from that sentence. 2. "Alerting and Render Limits" section, link for "concurrent_render_limit" takes you to the page but not the section. This seems to be the case for all section links on this "Configure Grafana" page. I'm not sure how to fix it but switched from a relative link to a full path to see if that would help. 3. "Install Grafana Image Renderer Plugin," the link goes to the plugin overview page instead of the installation page. I tried adding the full path to see if that would go to the installation tab. 4. "Configuration" section, the same as the second edit I made, the first link, "Grafana configuration file," goes to the page but not the section link. I switched the relative path to a full path to see if it would work. 5. "Security" section, the very last sentence has the same Grafana configuration page link that goes to the correct page but not the correct section, "Grafana configuration" for the renderer token section. Same as previous ones, I switched out the relative path for the full path. 6. "Start browser with additional arguments," the second link in the first paragraph that goes to Puppeteer list of Chromium flags went to a 404 page. I couldn't figure out where they had moved it so I found a different site with a list of default flags and used that link instead. * corrects links * updates links * fixes anchor link --------- Co-authored-by: Chris Moyer <chris.moyer@grafana.com>
2023-07-21 12:23:32 -05:00
Additional arguments to pass to the headless browser instance. Defaults are `--no-sandbox,--disable-gpu`. The list of Chromium flags can be found [here](https://peter.sh/experiments/chromium-command-line-switches/) and the list of flags used as defaults by Puppeteer can be found [there](https://cri.dev/posts/2020-04-04-Full-list-of-Chromium-Puppeteer-flags/). Multiple arguments is separated with comma-character.
```bash
RENDERING_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-accelerated-2d-canvas,--disable-gpu,--window-size=1280x758
```
```json
{
"rendering": {
"args": [
"--no-sandbox",
"--disable-setuid-sandbox",
"--disable-dev-shm-usage",
"--disable-accelerated-2d-canvas",
"--disable-gpu",
"--window-size=1280x758"
]
}
}
```
#### Ignore HTTPS errors
Instruct headless browser instance whether to ignore HTTPS errors during navigation. Per default HTTPS errors are not ignored.
Due to the security risk it's not recommended to ignore HTTPS errors.
```bash
IGNORE_HTTPS_ERRORS=true
```
```json
{
"rendering": {
"ignoresHttpsErrors": true
}
}
```
#### Default timezone
Instruct headless browser instance to use a default timezone when not provided by Grafana, .e.g. when rendering panel image of alert. See [ICUs metaZones.txt](https://cs.chromium.org/chromium/src/third_party/icu/source/data/misc/metaZones.txt?rcl=faee8bc70570192d82d2978a71e2a615788597d1) for a list of supported timezone IDs. Fallbacks to `TZ` environment variable if not set.
```bash
BROWSER_TZ=Europe/Stockholm
```
```json
{
"rendering": {
"timezone": "Europe/Stockholm"
}
}
```
#### Default language
Instruct headless browser instance to use a default language when not provided by Grafana, e.g. when rendering panel image of alert.
Refer to the HTTP header Accept-Language to understand how to format this value.
```bash
# Available from v3.9.0+
RENDERING_LANGUAGE="fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5"
```
```json
{
"rendering": {
"acceptLanguage": "fr-CH, fr;q=0.9, en;q=0.8, de;q=0.7, *;q=0.5"
}
}
```
#### Viewport width
Default viewport width when width is not specified in the rendering request. Default is `1000`.
```bash
# Available from v3.9.0+
RENDERING_VIEWPORT_WIDTH=1000
```
```json
{
"rendering": {
"width": 1000
}
}
```
#### Viewport height
Default viewport height when height is not specified in the rendering request. Default is `500`.
```bash
# Available from v3.9.0+
RENDERING_VIEWPORT_HEIGHT=500
```
```json
{
"rendering": {
"height": 500
}
}
```
#### Viewport maximum width
Limit the maximum viewport width that can be requested. Default is `3000`.
```bash
# Available from v3.9.0+
RENDERING_VIEWPORT_MAX_WIDTH=1000
```
```json
{
"rendering": {
"maxWidth": 1000
}
}
```
#### Viewport maximum height
Limit the maximum viewport height that can be requested. Default is `3000`.
```bash
# Available from v3.9.0+
RENDERING_VIEWPORT_MAX_HEIGHT=500
```
```json
{
"rendering": {
"maxHeight": 500
}
}
```
#### Device scale factor
Specify default device scale factor for rendering images. `2` is enough for monitor resolutions, `4` would be better for printed material. Setting a higher value affects performance and memory. Default is `1`.
This can be overridden in the rendering request.
```bash
# Available from v3.9.0+
RENDERING_VIEWPORT_DEVICE_SCALE_FACTOR=2
```
```json
{
"rendering": {
"deviceScaleFactor": 2
}
}
```
#### Maximum device scale factor
Limit the maximum device scale factor that can be requested. Default is `4`.
```bash
# Available from v3.9.0+
RENDERING_VIEWPORT_MAX_DEVICE_SCALE_FACTOR=4
```
```json
{
"rendering": {
"maxDeviceScaleFactor": 4
}
}
```
#### Page zoom level
The following command sets a page zoom level. The default value is `1`. A value of `1.5` equals 150% zoom.
```bash
RENDERING_VIEWPORT_PAGE_ZOOM_LEVEL=1
```
```json
{
"rendering": {
"pageZoomLevel": 1
}
}
```