diff --git a/conf/defaults.ini b/conf/defaults.ini index 173f4babdf5..bb66626204b 100644 --- a/conf/defaults.ini +++ b/conf/defaults.ini @@ -1562,6 +1562,10 @@ rendering_verbose_logging = # Default is false. This can be useful to enable (true) when troubleshooting. rendering_dumpio = +# Instruct headless browser instance whether to register metrics for the duration of every rendering step. Default is false. +# This can be useful to enable (true) when optimizing the rendering mode settings to improve the plugin performance or when troubleshooting. +rendering_timing_metrics = + # Additional arguments to pass to the headless browser instance. Default is --no-sandbox. The list of Chromium flags can be found # here (https://peter.sh/experiments/chromium-command-line-switches/). Multiple arguments is separated with comma-character. rendering_args = diff --git a/docs/sources/setup-grafana/configure-grafana/_index.md b/docs/sources/setup-grafana/configure-grafana/_index.md index 1cc623b843e..9e6a30d948e 100644 --- a/docs/sources/setup-grafana/configure-grafana/_index.md +++ b/docs/sources/setup-grafana/configure-grafana/_index.md @@ -2302,6 +2302,14 @@ Instruct headless browser instance whether to output its debug and error message It can be useful to set this to `true` when troubleshooting. +### rendering_timing_metrics + +> **Note:** Available from grafana-image-renderer v3.9.0+ + +Instruct a headless browser instance on whether to record metrics for the duration of every rendering step. Default is `false`. + +Setting this to `true` when optimizing the rendering mode settings to improve the plugin performance or when troubleshooting can be useful. + ### rendering_args Additional arguments to pass to the headless browser instance. Defaults are `--no-sandbox,--disable-gpu`. The list of Chromium flags can be found at (https://peter.sh/experiments/chromium-command-line-switches/). Separate multiple arguments with commas. diff --git a/docs/sources/setup-grafana/image-rendering/_index.md b/docs/sources/setup-grafana/image-rendering/_index.md index 8639cb7f7d0..61fd88e13dc 100644 --- a/docs/sources/setup-grafana/image-rendering/_index.md +++ b/docs/sources/setup-grafana/image-rendering/_index.md @@ -229,6 +229,25 @@ ENABLE_METRICS=true } ``` +#### 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`. @@ -370,6 +389,11 @@ BROWSER_TZ=Europe/Stockholm 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": { @@ -382,6 +406,11 @@ Refer to the HTTP header Accept-Language to understand how to format this value. 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": { @@ -394,6 +423,11 @@ Default viewport width when width is not specified in the rendering request. Def 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": { @@ -406,6 +440,11 @@ Default viewport height when height is not specified in the rendering request. D 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": { @@ -418,6 +457,11 @@ Limit the maximum viewport width that can be requested. Default is `3000`. 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": { @@ -431,6 +475,11 @@ Limit the maximum viewport height that can be requested. Default is `3000`. 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": { @@ -443,6 +492,11 @@ This can be overridden in the rendering request. 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": {