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

grafana-image-renderer: init at 2020-12-01 #108142

Merged
merged 2 commits into from Jan 1, 2021

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Jan 1, 2021

Motivation for this change

This package[1] is a replacement for the old phantomjs-integration[2]
which is practically EOL. It is basically used to render PNGs of panels
that triggered an alert in Grafana.

This package internally uses puppeteer[3] to control a headless
Chromium instance. Even though puppeteer recommends to use a fixed
revision of chromium, I checked that our default pkgs.chromium works
fine as well. Also, I don't think it's a good idea to use outdated
browser versions[4].

I used the latest revision from master on purpose since compiling the
code with tsc from v2.0 didn't work and I couldn't figure out why.

[1] https://grafana.com/grafana/plugins/grafana-image-renderer
[2] https://grafana.com/blog/2020/05/07/grafana-7.0-preview-new-image-renderer-plugin-to-replace-phantomjs/
[3] https://github.com/puppeteer/puppeteer
[4] currently, puppeteer v2.0.0 is used which recommends revision 706915
(v79.0.3945.130).

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

This package[1] is a replacement for the old phantomjs-integration[2]
which is practically EOL. It is basically used to render PNGs of panels
that triggered an alert in Grafana.

This package internally uses `puppeteer`[3] to control a headless
Chromium instance. Even though puppeteer recommends to use a fixed
revision of `chromium`, I checked that our default `pkgs.chromium` works
fine as well. Also, I don't think it's a good idea to use outdated
browser versions[4].

I used the latest revision from `master` on purpose since compiling the
code with `tsc` from `v2.0` didn't work and I couldn't figure out why.

[1] https://grafana.com/grafana/plugins/grafana-image-renderer
[2] https://grafana.com/blog/2020/05/07/grafana-7.0-preview-new-image-renderer-plugin-to-replace-phantomjs/
[3] https://github.com/puppeteer/puppeteer
[4] currently, puppeteer v2.0.0 is used which recommends revision 706915
    (v79.0.3945.130).
@WilliButz WilliButz merged commit 5e9d92c into NixOS:master Jan 1, 2021
@Ma27 Ma27 deleted the grafana-img-renderer branch January 1, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants