Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This plugin ignores config. How change settings? #342

Closed
Inetov opened this issue Apr 1, 2022 · 5 comments
Closed

This plugin ignores config. How change settings? #342

Inetov opened this issue Apr 1, 2022 · 5 comments
Labels
type/question Further information is requested

Comments

@Inetov
Copy link

Inetov commented Apr 1, 2022

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: ?
@AgnesToulet
Copy link
Contributor

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

@AgnesToulet AgnesToulet added the type/question Further information is requested label Apr 5, 2022
@Inetov
Copy link
Author

Inetov commented Apr 5, 2022

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

@Codecaver
Copy link

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 ?

@joanlopez
Copy link
Collaborator

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!

@AgnesToulet
Copy link
Contributor

Closing this in favor of #392

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants