-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Reporting/Dashboard] Use Chromium for print-optimized PDFs #130546
[Reporting/Dashboard] Use Chromium for print-optimized PDFs #130546
Conversation
@elasticmachine merge upstream |
Benchmark testsThese results used the three "print layout" tests from elastic/kibana-reporting-benchmarks repo. The average execution time using the changes in this PR: 12.846 seconds Take a look at the dashboard set up from the logs of the test runs. The "Execution duration" chart is split by the server UUID: the blue line is the timings with a build of this PR, and the green line is the snapshot build. The other stats: event loop delay, heap memory size, chromium memory size, etc. look virtually the same.
|
If the styles of footers and headers is an issue we can consider using something like this: https://www.npmjs.com/package/puppeteer-report |
@elasticmachine merge upstream |
@tsullivan I think I've addressed your feedback:
we should also merge #131600 but I don't think we need to block this PR. Would you mind taking another look? |
log.info( | ||
`expecting all time stats to report ${count} ${jobType} job types (actual: ${actual})` | ||
); | ||
expect(actual).to.be(count); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry this test was such a pain. It's very old and was made before snapshots were a thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have some percolating thoughts about calculating the page numbers of the PDF for telemetry, but let's save those for later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Casing changes LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code owner review - LGTM 👍
…hromium-to-print-pdf-part-1 * 'main' of github.com:elastic/kibana: (59 commits) [Cloud Posture] Enabled findings group by feature (elastic#131780) [EBT] Fix `userId` generation (elastic#131701) [RAM] Add shareable rule tag filter (elastic#130710) Optimize package installation performance, phase 2 (elastic#131627) [Screenshotting] instrument for benchmark tests using new EventLogger class (elastic#130356) [Connector] Adding internal route for requesting ad-hoc ServiceNow access token (elastic#131171) [ci] bump kibana-buildkite-library (elastic#131754) [Synthetics] UI clean up (elastic#131598) [RsponseOps] Fix flaky rules list test (elastic#131567) [Cases] Add severity field to create case (elastic#131626) [Discover] Monospace font in Document Explorer (elastic#131513) Sessions tab improvements (elastic#131583) Add cloud icon "ess-icon" at the end of the config keys in "alerting" documentation (elastic#131735) [DOCS] Updates deprecation text for legacy APIs (elastic#131741) [ci] break out skip patterns so they can change without triggering CI (elastic#131726) Adjust search session management page font size (elastic#131291) [Unified search] Fix uptime css problem (elastic#131730) [Actionable Observability] Link to filtered rules page (elastic#131629) Add openAPI specifications for cases endpoint (elastic#131275) Display rule API key owner to users who can manage API keys (elastic#131662) ... # Conflicts: # x-pack/plugins/screenshotting/server/formats/pdf/index.ts # x-pack/plugins/screenshotting/server/screenshots/observable.ts
@elasticmachine merge upstream |
@elasticmachine merge upstream |
…ed an issue; need to figure out what exactly the issue was...
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
It is possible to request a "print-optimized" PDF from dashboard (our most popular app for making print-focussed reports). Today we use a native NPM dependency instead of Chromium for generating the PDF. We can improve performance of generating these PDFs by leveraging the print functionality native to browsers since we are already using headless Chromium.
Screenshots
Note: header and footers are included via puppeteers
footerTemplate
andheaderTemplate
(see their docs). Note: header is outdated in screenshotSamples
Benchmarks
See #130546 (comment)
Additional notes
Needs benchmarks (CC @tsullivan )Checklist
Risk Matrix
For maintainers