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

Config: Improve consistency between plugin and server mode #477

Merged
merged 8 commits into from Nov 9, 2023

Conversation

AgnesToulet
Copy link
Contributor

@AgnesToulet AgnesToulet commented Oct 24, 2023

This PR refactor the configuration codebase to de-duplicate the code that handles setting the config via environment variables in plugin mode and in server mode.

It also improves the consistency between how you can configure the image renderer as a plugin and as a remote server with environment variables. This adds the following env variables:

  • RENDERING_LANGUAGE (server mode)
  • RENDERING_VIEWPORT_WIDTH (server mode)
  • RENDERING_VIEWPORT_HEIGHT (server mode)
  • RENDERING_VIEWPORT_DEVICE_SCALE_FACTOR (server mode)
  • RENDERING_VIEWPORT_MAX_WIDTH (server mode)
  • RENDERING_VIEWPORT_MAX_HEIGHT (server mode)
  • RENDERING_VIEWPORT_MAX_DEVICE_SCALE_FACTOR (server mode)
  • GF_PLUGIN_RENDERING_TIMING_METRICS (plugin mode) and RENDERING_TIMING_METRICS (server mode)

Fixes #392 and fixes #317

Associated doc PR: grafana/grafana#77042

@AgnesToulet AgnesToulet added the type/enhancement New feature or request label Oct 24, 2023
src/config.ts Outdated
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was splitted between config/*.ts, plugin/v2/config.ts and service/config.ts files.

@AgnesToulet AgnesToulet marked this pull request as ready for review October 24, 2023 09:51
@AgnesToulet AgnesToulet requested review from a team, juanicabanas and evictorero and removed request for a team October 24, 2023 12:44
Copy link
Contributor

@evictorero evictorero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a comment with a suggestion but PR looks good and it is consistent with the docs change.

src/config/rendering.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@evictorero evictorero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Leave one nit comment.

src/service/config.ts Outdated Show resolved Hide resolved
@AgnesToulet AgnesToulet merged commit c13be0d into master Nov 9, 2023
4 checks passed
@AgnesToulet AgnesToulet deleted the config-updates branch November 9, 2023 16:00
@zifter
Copy link

zifter commented Nov 20, 2023

Hello,

сould you give us an idea of when this improvement will be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Review Image Renderer settings coherency (standalone vs plugin) Enable timingMetrics in plugin mode
3 participants