本地 PC 等无 metadata server 的环境需先执行 gcloud auth application-default login 并挂载 ADC 凭据文件;KHI 无认证授权机制,切勿把 8080 端口暴露到公网;仅测试并支持最新版 Chrome,其他浏览器不提供支持。
khi
GoogleCloudPlatformApache-2.0活跃维护把 Kubernetes 集群日志按时间线可视化,帮助快速定位故障根因,排查 K8s 问题比翻原始日志高效得多。
A log viewer for Kubernetes troubleshooting
docker run -p 127.0.0.1:8080:8080 gcr.io/kubernetes-history-inspector/release:latestREADME 未说明硬件要求;运行环境需 docker 命令和最新版 Google Chrome,未提及 GPU 或显存。
把 Kubernetes 海量日志转成可交互时间线的无代理排障工具
把 Kubernetes 集群日志按时间线可视化,帮助快速定位故障根因,排查 K8s 问题比翻原始日志高效得多。
核心能力
- 将审计日志与资源状态变化渲染成时间线图表和 manifest diff
- 仅凭 kube-apiserver 审计日志绘制资源关系拓扑图
- 无需在集群内部署 agent 即可采集日志
- 支持 Cloud Logging 或直接上传 JSONlines 日志文件
- 提供 Job 模式,可在 CI/CD 和告警触发中无界面运行
容易踩的坑
- v0.61.1KHI v0.61.1最新正式版2026-10-29 · 2026-10-29 08:09 UTC
What's Changed
New features 🎉
- feat(googlecloud): report missing IAM roles on permission errors and preserve client error types by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1190
Other Changes 🛠
- refactor(testutil): add CompareStructuredNode helper for revision tests by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1185
- refactor(mcp): unify workbench pagination defaults and ID formatting by @Ackberry in https://github.com/GoogleCloudPlatform/khi/pull/1186
Full Changelog: https://github.com/GoogleCloudPlatform/khi/compare/v0.61.0...v0.61.1
- v0.61.0KHI v0.61.02026-10-29 · 2026-10-29 03:58 UTC
查看更新说明
What's Changed
New features 🎉
- feat(mcp): add KHI Model Context Protocol server for agentic cluster investigation by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1177
Bug Fixes 🐛
- fix(workbench): avoid narrowing uint32 conversion in log index lookups by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1182
Refactoring ♻️
- refactor(logutil): standardize KLogTextParser and reconstruct full klog lines for control plane logs by @Ackberry in https://github.com/GoogleCloudPlatform/khi/pull/1162
Documentation 📝
- docs(agent): add table-driven test want structuring rules to go-coding-rule.md by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1173
Other Changes 🛠
- docs(agent): add test data sanitization rules by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1174
- feat(caik8s): make Cloud Asset Inventory resource snapshot fetching a toggleable feature by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1169
- fix(workbench): use max timeline ID instead of timeline count for filter bitset by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1175
- feat(k8sevent): discover node names from Kubernetes Event logs by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1176
- feat(serialport): link Pod and Node timelines via Pod UIDs in serial port logs by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1181
Maintenance 🧹
- build(deps): update npm dependencies to supersede Dependabot PRs by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1183
Full Changelog: https://github.com/GoogleCloudPlatform/khi/compare/v0.60.1...v0.61.0
- v0.60.1KHI v0.60.12026-10-22 · 2026-10-22 05:53 UTC
查看更新说明
What's Changed
New features 🎉
- feat(k8snode): bind container and pod sandbox IDs in all node component logs by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1028
- feat: add timeline time range filtering across the backend pipeline and frontend UI by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1032
- feat(cai): report determinate progress and scanned resource counts during CAI fetching by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1035
- feat: add inspection name form field and enforce unique inspection names by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1036
- feat(web): retry transient failures when fetching frontend assets and resources by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1053
- feat(k8saudit): resolve undetermined resource names from request/response metadata and generateName by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1148
Bug Fixes 🐛
- fix(web): forward filterStartTime and filterEndTime in the legacy polling FilterTimeline adapter by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1034
- fix(web): bound HistogramCache range to the inspection query time range by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1037
- fix(task): preserve error chain with TaskError and record task errors in TaskRunStatus by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1050
- fix(web): render font ligature icon instead of svgIcon in index progress overlay by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1055
- fix(backend): validate non-nil VerbType in changeset and assign VerbUnknown fallback in autoscaler and oss k8s by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1059
- fix(k8scontainer): use audit timeline creation time inventory instead of querying builder state by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1086
- fix(k8saudit): prevent condition timeline inversion and stale inferred creation states by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1093
- fix(workbench): treat missing CEL path levels as empty strings instead of aborting the timeline filter by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1123
Refactoring ♻️
- refactor(task): separate feature activation gate from data dependencies via WithFeatureGate by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1051
- refactor(web): decompose NewInspectionDialogComponent into smart and dumb components by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1052
- refactor(inspection): remove task graph plan metadata and link new inspection dialog to task graph debugger by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1054
- refactor(backend): unify lifecycle hooks and expose Connect-RPC handler options by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1069
- refactor(task): Task system v4 — Binder-based dependency declaration and declarative Module registration by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1116
CI/CD ⚙️
- build(deps): update Go to 1.27.3, Node.js to 26.12.1, and golangci-lint to v2.15.0 by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1159
Development Environment 💻
- build(deps): update npm dependencies to supersede Dependabot PRs by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1155
Documentation 📝
- docs: document Cloud Asset Inventory permissions and supplementary role by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1033
Other Changes 🛠
- fix(web): prevent parameter hint text from overflowing container border by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/1056
Maintenance 🧹
- chore(agent): remove requirement for user approval before push by @kyasbal in https://github.c
- v0.59.0KHI v0.59.02026-09-18 · 2026-09-18 14:18 UTC
查看更新说明
What's Changed
New features 🎉
- feat(k8sevent): replace resource UIDs with readable names in event summaries by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/973
- feat(googlecloudk8scommon): default kind filter to all kinds except leases by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/975
- feat(timeline): allow inline editing of search filter chips on click by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/977
- feat(cicd): support manual tag and release draft generation via workflow_dispatch by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/980
- feat(inspection): set default environment name in composer form by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/982
- feat(dev): support configurable ports and hosts for multi-workspace and cloudtop by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/983
- feat(task): add task description label and WithTaskDescription option by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/985
- feat(inspection): add checkbox form field type by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/986
- feat(commonlogk8saudit): add initial resource state provider contract and integrate with audit log pipeline by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/990
- feat(googlecloudcaik8s): implement GKE existing resource inspection via Cloud Asset Inventory by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/991
- feat(inspection): include job command in metadata and allow starting inspection from job command by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/993
- feat(task): introduce Task System v3 by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1001
- feat(googlecloudcaik8s): generate GKE cluster and nodepool timeline revisions from Cloud Asset Inventory by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1002
Bug Fixes 🐛
- fix(inspection): resolve timezone offset fallback to UTC by unifying to timezoneShiftHours by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/978
- fix(k8saudit): preserve immutable identity metadata after truncated logs by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/979
- fix(googlecloudcaik8s): set VerbUpdate on CAI snapshot revision when creation timestamp is present by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/994
- fix(googlecloudcommon): cancel context on receiver exit to prevent deadlock in TestLogFetcherImpl_FetchLogs by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1004
- fix(googlecloudcommon): use 1m timeout context and assert on expiration in TestLogFetcherImpl_FetchLogs by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1006
- fix(k8scontainer): prevent container log pod phase mapper from overwriting CAI pod revisions and resolve CAI pod UID by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1009
- fix(build): increase ESLint memory limit to 12288MB (#999) by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1012
- fix(task): prevent disabled feature pipelines from leaking into the active graph by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1014
- fix(composer): inject APIClientFactory and CallOptionsInjector into EnvironmentClusterFinderImpl by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1015
- fix(upload): propagate pending field and wait for verification on run by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1017
- fix(server): serve SPA index.html for /debug/*wild routes (#1021) by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/1024
Refactoring ♻️
- refactor(inspection): remove legacy LabelKeyInspectionTypes and InspectionTypeLabel by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/981
- refactor(inspection
- v0.58.2KHI v0.58.22026-09-03 · 2026-09-03 11:35 UTC
查看更新说明
We've migrated the majority of the features from frontend heavy architecture to backend side. This enables us to gather logs even over 10M logs. In addition to this big architecture change, we've implemented full text search index in backend side. This allows us to search resources containing logs with specific keywords really faster. It would return the full text search query for 10M logs in few secounds!
Note I'll skip v0.58.0 and v0.58.1 for OSS release for some reasons. This v0.58.2 is our first release of v0.58.x.
What's Changed
Bug Fixes 🐛
- perf(web): pool and reuse layout components across layout transitions by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/904
- fix(web): update form validation on in-flight requests and migrate to signals by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/907
- fix(progressutil): resolve race condition in ProgressUpdator by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/910
- fix(inspection): fix missing filter resource name fields and query estimation metadata by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/911
- fix(timeline): resolve shader asset paths relative to baseUrl and cache WebGL assets by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/929
- perf(core): optimize orderedMapNode reader access and release raw logs after ingestion by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/931
- fix(csm): return structured.Node from TrackAndGetManifest to fix ResourceBody intern error by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/943
- fix(inspection/googlecloudcommon): avoid race condition dropping partition boundary logs in log fetcher by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/947
- fix(timeline): unify dashed border stripe coordinates to screen pixels by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/949
- Handle truncated Kubernetes audit logs by @Haihan-Jiang in https://github.com/GoogleCloudPlatform/khi/pull/697
Development Environment 💻
- feat(taskrecord): introduce DAG task record and replay test framework by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/924
- docs(skills): add backward-compatibility-policy skill and update coding rules by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/939
Documentation 📝
- docs: add release notes for v0.58.0 by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/927
Other Changes 🛠
- perf: introduce DAG-based Initializer system, eliminate ServerFactory, and remove ViewerMode by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/890
- feat(api,web): introduce Connect-RPC and chunked .khi file import workflow by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/891
- feat: introduce Workbench service with backend CEL filtering and on-demand struct loading by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/892
- feat(khifile): partition client and server intern pools into dedicated chunks by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/893
- feat: display the summary of envoy access logs by @K53 in https://github.com/GoogleCloudPlatform/khi/pull/887
- perf(workbench,filter): optimize filter result payload with SparseBitset and IdBitset by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/894
- feat(inspection): structured log query estimation and inspection log volume UI redesign by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/895
- feat(popup): migrate popup service to Connect-RPC with server-streaming WatchPopup and polymorphic UI registry by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/897
- feat(googlecloud): add adaptive rate limiter for Cloud Logging API queries by @kyasbal in https://github.com/GoogleCloudPlatform/khi/pull/896
- feat(upload): migrate
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Kubernetes History Inspector
Kubernetes History Inspector (KHI) is a rich log visualization tool for Kubernetes clusters. KHI transforms vast quantities of logs into an interactive, comprehensive timeline view. This makes it an invaluable tool for troubleshooting complex issues that span multiple components within your Kubernetes clusters. Also, KHI is agentless, allowing anyone to access its features without a complicated process.
Getting started
The easiest way to try KHI is using Cloud Shell, where the metadata server is available without requiring initial credential setup.
Running in Cloud Shell
-
Open Cloud Shell
-
Run the following command:
docker run -p 127.0.0.1:8080:8080 gcr.io/kubernetes-history-inspector/release:latest -
Click the link
http://localhost:8080on the terminal and start working with KHI!
Running in environment without a metadata server (Local PC, etc.)
If you want to run KHI in an environment where the metadata server is not available, you can use Application Default Credentials (ADC) by mounting your ADC file from your host filesystem to the container.
For Linux, MacOS or WSL
gcloud auth application-default login
docker run \
-p 127.0.0.1:8080:8080 \
-v ~/.config/gcloud/application_default_credentials.json:/root/.config/gcloud/application_default_credentials.json:ro \
gcr.io/kubernetes-history-inspector/release:latest
For Windows PowerShell
gcloud auth application-default login
docker run `
-p 127.0.0.1:8080:8080 `
-v $env:APPDATA\gcloud\application_default_credentials.json:/root/.config/gcloud/application_default_credentials.json:ro `
gcr.io/kubernetes-history-inspector/release:latest
- For running KHI in automated workflows (CI/CD, alert triggers, etc.) without starting the web server, see the Job Mode Guide.
- To build KHI from source code, see the Development Guide.
- For more details, try Getting started.
Supported Products & Environments
Kubernetes cluster
-
Google Cloud
-
Other
- kube-apiserver audit logs as JSONlines (Tutorial)
Logging backend
-
Google Cloud
- Cloud Logging (Primary log source for all clusters on Google Cloud)
- Cloud Asset Inventory (Supplementary: used optionally to reconstruct initial state snapshots for pre-existing resources)
-
Other
- Log file upload (Tutorial)
Supported environment
- Latest Google Chrome
dockercommand
[!IMPORTANT] We only test KHI on the latest version of Google Chrome. KHI may work with other browsers, but we do not provide support if it does not.
Environment Setup Guide
Google Cloud
Read Google Cloud Permissions & Configuration Guide.
OSS Kubernetes
Read Using KHI with OSS Kubernetes Clusters - Example with Loki.
User Guide
Please refer to the User Guide for detailed usage.
Development Contribution Guide
If you'd like to contribute to the project KHI, read Contribution Guide and then follow Development Guide
Disclaimer
Please note that this tool is not an officially supported Google Cloud product. If you find any issues and have a feature request, file a Github issue on this repository and we are happy to check them on best-effort basis.
[!IMPORTANT] Do not expose KHI port on the internet. KHI itself is not providing any authentication or authorization features and KHI is intended to be accessed from its local user.