docs: add debugging guide for Kmesh daemon#1755
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces a new documentation file to improve the observability and maintainability of Kmesh. By providing a centralized reference for debugging tools and endpoints, it empowers users to diagnose issues within the Kmesh daemon more effectively without needing to inspect the source code directly. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. The daemon runs with silent grace, / But bugs may hide in every space. / With logs and dumps we clear the way, / To keep the Kmesh bright today. Footnotes
|
|
Welcome @aeron-gh! It looks like this is your first PR to kmesh-net/kmesh 🎉 |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds a new debugging guide for Kmesh, documenting how to inspect a running kmesh-daemon via kmeshctl, kubectl, and the local admin HTTP endpoints.
Changes:
- Documented daemon log access and runtime log level adjustment.
- Added guidance for config dumps, authz debugging, readiness checks, monitoring, and pprof profiling.
- Included a quick-reference table mapping common tasks to
kmeshctland HTTP endpoints.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| | Task | `kmeshctl` | HTTP endpoint (`localhost:15200`) | | ||
| | --- | --- | --- | | ||
| | Daemon logs | `kubectl logs` | — | |
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive debugging guide for Kmesh, detailing how to use the admin interface, adjust log levels, view configuration dumps, and monitor traffic. Feedback on the quick reference table points out that several kmeshctl commands are incomplete and would fail validation, and a suggestion has been provided to include placeholders and correct the markdown formatting.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| | Task | `kmeshctl` | HTTP endpoint (`localhost:15200`) | | ||
| | --- | --- | --- | | ||
| | Daemon logs | `kubectl logs` | — | | ||
| | List / set log level | `kmeshctl log` | `/debug/loggers` | | ||
| | Config dump | `kmeshctl dump` | `/debug/config_dump/{dual-engine,kernel-native}` | | ||
| | eBPF map dump | — | `/debug/config_dump/bpf/{dual-engine,kernel-native}` | | ||
| | Access logs | `kmeshctl monitoring --accesslog` | `/accesslog` | | ||
| | Monitoring / metrics | `kmeshctl monitoring` | `/monitoring`, `/workload_metrics`, `/connection_metrics` | | ||
| | Authorization | `kmeshctl authz` | `/authz` | | ||
| | Version | `kmeshctl version` | `/version` | | ||
| | Readiness | — | `/debug/ready` | | ||
| | Profiling | — | `/debug/pprof/` | |
There was a problem hiding this comment.
Several commands listed in the quick reference table will fail with CLI parsing/validation errors or do nothing if executed exactly as written:
kmeshctl logrequires at least 1 argument (the pod name) and will fail withError: accepts at least 1 arg(s), received 0.kmeshctl dumprequires exactly 2 arguments (pod name and mode) and will fail withError: accepts 2 arg(s), received 0.kmeshctl monitoringrequires at least one flag (e.g.,--accesslog,--all, etc.) to perform any action.kmeshctl authzrequires a subcommand (enable,disable, orstatus) to function.
Updating the table to include placeholders (like <pod>, <mode>, and <flags>) and escaping the pipe | characters (to prevent breaking the markdown table rendering) will make the quick reference accurate and user-friendly.
| | Task | `kmeshctl` | HTTP endpoint (`localhost:15200`) | | |
| | --- | --- | --- | | |
| | Daemon logs | `kubectl logs` | — | | |
| | List / set log level | `kmeshctl log` | `/debug/loggers` | | |
| | Config dump | `kmeshctl dump` | `/debug/config_dump/{dual-engine,kernel-native}` | | |
| | eBPF map dump | — | `/debug/config_dump/bpf/{dual-engine,kernel-native}` | | |
| | Access logs | `kmeshctl monitoring --accesslog` | `/accesslog` | | |
| | Monitoring / metrics | `kmeshctl monitoring` | `/monitoring`, `/workload_metrics`, `/connection_metrics` | | |
| | Authorization | `kmeshctl authz` | `/authz` | | |
| | Version | `kmeshctl version` | `/version` | | |
| | Readiness | — | `/debug/ready` | | |
| | Profiling | — | `/debug/pprof/` | | |
| | Task | `kmeshctl` | HTTP endpoint (`localhost:15200`) | | |
| | --- | --- | --- | | |
| | Daemon logs | `kubectl logs -n kmesh-system <pod>` | — | | |
| | List / set log level | `kmeshctl log <pod> [--set <logger>:<level>]` | `/debug/loggers` | | |
| | Config dump | `kmeshctl dump <pod> <mode>` | `/debug/config_dump/{dual-engine,kernel-native}` | | |
| | eBPF map dump | — | `/debug/config_dump/bpf/{dual-engine,kernel-native}` | | |
| | Access logs | `kmeshctl monitoring [<pod>] --accesslog <enable\|disable>` | `/accesslog` | | |
| | Monitoring / metrics | `kmeshctl monitoring [<pod>] <flags>` | `/monitoring`, `/workload_metrics`, `/connection_metrics` | | |
| | Authorization | `kmeshctl authz <enable\|disable\|status> [<pod>]` | `/authz` | | |
| | Version | `kmeshctl version [<pod>]` | `/version` | | |
| | Readiness | — | `/debug/ready` | | |
| | Profiling | — | `/debug/pprof/` | |
39e8173 to
753422a
Compare
60f4dd3 to
548d052
Compare
| | Daemon logs | `kubectl logs -n kmesh-system <pod>` | — | | ||
| | List / set log level | `kmeshctl log <pod> [--set <logger>:<level>]` | `/debug/loggers` | | ||
| | Config dump | `kmeshctl dump <pod> <mode>` | `/debug/config_dump/{dual-engine,kernel-native}` | |
Document how to debug a running kmesh-daemon: the localhost:15200 admin interface, viewing logs and changing log levels (incl. the bpf logger), the config dump (and eBPF map dump), access logs/metrics, authorization, version, readiness and pprof. Signed-off-by: aeron-gh <agab0323@gmail.com>
548d052 to
b925314
Compare
Fixes #733
Adds
docs/en/kmesh_debugging.md, a guide for debugging a running Kmesh daemon. It documents:localhost:15200and how to reach it (kmeshctlorkubectl exec+curl)bpflogger for eBPF program logs (kmeshctl log)kmeshctl dump,/debug/config_dump/...)kmeshctl monitoring)kmeshctl authz), version, readiness, and pprofSpecial notes for your reviewer
AI assistance: this guide was drafted with the help of an AI tool. As the author I have reviewed it and cross-checked every command and endpoint against the
kmeshctlsource (ctl/) and the admin server (pkg/status/status_server.go). I have not run the commands against a live cluster, so corrections from a cluster test are very welcome.