## Summary This PR applies **lossless compression** to all SVG and JPG/PNG assets across Kibana using: - [`svgo`](https://github.com/svg/svgo) — for optimizing SVGs - [`image-optimize`](https://www.npmjs.com/package/image-optimize) — for JPG/PNG compression ‼️**Please scroll to ''Unknown metric groups" accordion to see what's the gain for your code.** <img width="542" alt="Screenshot 2025-06-18 at 13 24 20" src="https://github.com/user-attachments/assets/191afb28-44fc-4551-9026-756a8385c66a" /> The goal is to reduce asset size and improve load performance without compromising visual quality. This PR achieves a **23 MB** reduction in asset size across all images bundled in Kibana’s running code—meaning these compressed images directly impact what ships in Kibana. Some assets get bundled into chunks due to our bundling strategy but might not actually be requested at runtime. Additionally, I ran the same optimization script on the docs assets as a harmless extra step, but those savings aren’t included in the 23 MB total. --- ## Why While working on Emotion rewrites, I noticed some SVGs seemed unnecessarily heavy. That led to a broader investigation into our image assets, and it turns out we’re not consistently optimizing them during development or build. --- ## Notes - Visual fidelity of optimized assets has been manually verified — no visible differences - The optimization is **lossless**, meaning no quality degradation - Some assets (like large background images) could benefit further from **lossy compression** --- ## Follow-ups / Ideas 1. **Automate compression in the dev/build pipeline** - e.g. add `svgo` as a pre-commit or CI step for SVGs 2. **Improve CI reporting** - Currently, bundle size diffs for images are hidden under "Unknown metric groups" in the GitHub CI comment. We may want to make these more visible. - 3. **Audit large assets manually** — apply lossy compression where appropriate 4. **Avoid redundant image loading** - e.g. background images on the login page are loaded again on the space selector page since they’re bundled twice. I’m working on a separate PR to address that. ## Snippets I used to apply the compression ``` # Find SVG files find . -type f -iname "*.svg" \ -not -path "*/node_modules/*" \ -not -path "*/functional/*" > svg-files.txt # Compress SVGs while IFS= read -r file; do svgo "$file" done < svg-files.txt ``` This snippet has been used for png and jpg, but the example below is for png: ``` # Find PNG files find . -type f -iname "*.png \ -not -path "*/node_modules/*" \ -not -path "*/functional/*" > png-files.txt # Compress PNGs while IFS= read -r file; do image-optimize -f jpg "$file" done < png-files.txt ``` |
||
---|---|---|
.buildkite | ||
.devcontainer | ||
.github | ||
api_docs | ||
config | ||
dev_docs | ||
docs | ||
examples | ||
kbn_pm | ||
legacy_rfcs | ||
licenses | ||
oas_docs | ||
packages | ||
plugins | ||
scripts | ||
src | ||
typings | ||
x-pack | ||
.backportrc.json | ||
.bazelignore | ||
.bazeliskversion | ||
.bazelrc | ||
.bazelrc.common | ||
.bazelversion | ||
.browserslistrc | ||
.editorconfig | ||
.eslintignore | ||
.eslintrc.js | ||
.gitattributes | ||
.gitignore | ||
.i18nrc.json | ||
.node-version | ||
.npmrc | ||
.nvmrc | ||
.prettierignore | ||
.prettierrc | ||
.puppeteerrc | ||
.stylelintignore | ||
.stylelintrc | ||
.telemetryrc.json | ||
.yarnrc | ||
BUILD.bazel | ||
catalog-info.yaml | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.md | ||
FAQ.md | ||
fleet_packages.json | ||
github_checks_reporter.json | ||
kibana.d.ts | ||
LICENSE.txt | ||
NOTICE.txt | ||
package.json | ||
preinstall_check.js | ||
README.md | ||
renovate.json | ||
RISK_MATRIX.mdx | ||
run_fleet_setup_parallel.sh | ||
SECURITY.md | ||
sonar-project.properties | ||
STYLEGUIDE.mdx | ||
tsconfig.base.json | ||
tsconfig.browser.json | ||
tsconfig.browser_bazel.json | ||
tsconfig.json | ||
TYPESCRIPT.md | ||
updatecli-compose.yaml | ||
versions.json | ||
WORKSPACE.bazel | ||
yarn.lock |
Kibana
Kibana is your window into the Elastic Stack. Specifically, it's a browser-based analytics and search dashboard for Elasticsearch.
- Getting Started
- Documentation
- Version Compatibility with Elasticsearch
- Questions? Problems? Suggestions?
Getting Started
If you just want to try Kibana out, check out the Elastic Stack Getting Started Page to give it a whirl.
If you're interested in diving a bit deeper and getting a taste of Kibana's capabilities, head over to the Kibana Getting Started Page.
Using a Kibana Release
If you want to use a Kibana release in production, give it a test run, or just play around:
- Download the latest version on the Kibana Download Page.
- Learn more about Kibana's features and capabilities on the Kibana Product Page.
- We also offer a hosted version of Kibana on our Cloud Service.
Building and Running Kibana, and/or Contributing Code
You might want to build Kibana locally to contribute some code, test out the latest features, or try out an open PR:
- CONTRIBUTING.md will help you get Kibana up and running.
- If you would like to contribute code, please follow our STYLEGUIDE.mdx.
- For all other questions, check out the FAQ.md and wiki.
Documentation
Visit Elastic.co for the full Kibana documentation.
For information about building the documentation, see the README in elastic/docs.
Version Compatibility with Elasticsearch
Ideally, you should be running Elasticsearch and Kibana with matching version numbers. If your Elasticsearch has an older version number or a newer major number than Kibana, then Kibana will fail to run. If Elasticsearch has a newer minor or patch number than Kibana, then the Kibana Server will log a warning.
Note: The version numbers below are only examples, meant to illustrate the relationships between different types of version numbers.
Situation | Example Kibana version | Example ES version | Outcome |
---|---|---|---|
Versions are the same. | 7.15.1 | 7.15.1 | 💚 OK |
ES patch number is newer. | 7.15.0 | 7.15.1 | ⚠️ Logged warning |
ES minor number is newer. | 7.14.2 | 7.15.0 | ⚠️ Logged warning |
ES major number is newer. | 7.15.1 | 8.0.0 | 🚫 Fatal error |
ES patch number is older. | 7.15.1 | 7.15.0 | ⚠️ Logged warning |
ES minor number is older. | 7.15.1 | 7.14.2 | 🚫 Fatal error |
ES major number is older. | 8.0.0 | 7.15.1 | 🚫 Fatal error |
Questions? Problems? Suggestions?
- If you've found a bug or want to request a feature, please create a GitHub Issue. Please check to make sure someone else hasn't already created an issue for the same topic.
- Need help using Kibana? Ask away on our Kibana Discuss Forum and a fellow community member or Elastic engineer will be glad to help you out.