grafana-image-renderer
grafana-image-renderer copied to clipboard
This plugin ignores config. How change settings?
What happened:
Hi! I am trying to follow the instructions: https://grafana.com/docs/grafana/next/image-rendering/
In my case, this is the plugin mode.
Trying to change quality of picture, I made the following changes to my config file (/etc/grafana/grafana.ini
):
rendering_viewport_device_scale_factor = 2
rendering_viewport_max_width = 1280
rendering_viewport_max_height = 640
rendering_viewport_max_device_scale_factor = 4
even tried adding --window-size=1280x640
to rendering_args
...
but every time I see in the log:
logger=rendering renderer=plugin t=2022-04-02T02:04:31.03+0300 lvl=dbug msg="Calling renderer plugin" req="url:\"http://localhost:3000/d-solo/Z_ov_As7k/all-servers-stats?orgId=1&panelId=8&render=1\" width:1000 height:500 deviceScaleFactor:1 filePath:\"/var/lib/grafana/png/HpySZFwXdlfyHA4ZcP8S.png\" renderKey:\"ceic3WlvNO7Dsv3lZYht3mStXIJ269hZ\" domain:\"localhost\" timeout:15"
As I see: the plugin receives an image of 1000x500, with scale factor = 1. The main question is: why?
After changes grafana.ini
I restarted grafana-server
.
What you expected to happen: I expect the plugin to react to changing settings)
How to reproduce it (as minimally and precisely as possible): Just edit config file...
Environment:
- Grafana Image Renderer version: 3.4.2
- Grafana version: 8.4.4
- Installed plugin or remote renderer service: installed plugin
- OS Grafana Image Renderer is installed on: Debian 10
- User OS & Browser: Windows 10, Chrome
- Others: ?
Hi!
The rendering_viewport_device_scale_factor
setting is used for background rendering (for legacy alerting for example) but for direct panel rendering, it should be set in the rendering request URL directly. Also the other parameters are to set a maximum to what can be set in the URL by users but are not used as default values.
To set the width, height and scale when rendering a panel, you should set this information as query parameters in this rendering request:
http://localhost:3000/render/d-solo/jIoUIXH7k/full-dashboard-grid-layout-test?orgId=1&from=1649150232441&to=1649171832441&panelId=4&width=1280&height=640&scale=2
Hi! yes, in my installation this plugin is used for legacy alerting. how can i improve the quality of the pictures? I don't know how to add/change parameters in URL in config..
Hi!
The
rendering_viewport_device_scale_factor
setting is used for background rendering (for legacy alerting for example) but for direct panel rendering, it should be set in the rendering request URL directly. Also the other parameters are to set a maximum to what can be set in the URL by users but are not used as default values.To set the width, height and scale when rendering a panel, you should set this information as query parameters in this rendering request:
http://localhost:3000/render/d-solo/jIoUIXH7k/full-dashboard-grid-layout-test?orgId=1&from=1649150232441&to=1649171832441&panelId=4&width=1280&height=640&scale=2
can I change the default values of width and height ?
Hi @Codecaver,
can I change the default values of width and height ?
Seems it is supported, but only when running the renderer as gRPC plugin, through environment variables: https://github.com/grafana/grafana-image-renderer/blob/master/src/plugin/v2/grpc_plugin.ts#L274-L280
I'm going to create an issue to evaluate if that should be supported when running the renderer as standalone application, as well.
Thanks!
Closing this in favor of https://github.com/grafana/grafana-image-renderer/issues/392