rpk debug bundle
The rpk debug bundle command collects environment data that can help debug and diagnose issues with a Redpanda cluster, a broker, or the machine it’s running on. It then bundles the collected data into a ZIP file, called a diagnostics bundle.
In Kubernetes, you must run the rpk debug bundle command inside a container that’s running a Redpanda broker.
|
Diagnostic bundle files
The files and directories in the diagnostics bundle differ depending on the environment in which Redpanda is running:
Common files
-
Kafka metadata: Broker configs, topic configs, start/committed/end offsets, groups, group commits.
-
Controller logs: The controller logs directory up to a limit set by
--controller-logs-size-limitflag -
Data directory structure: A file describing the data directory’s contents.
-
redpanda configuration: The redpanda configuration file (
redpanda.yaml; SASL credentials are stripped). -
/proc/cpuinfo: CPU information like make, core count, cache, frequency.
-
/proc/interrupts: IRQ distribution across CPU cores.
-
Resource usage data: CPU usage percentage, free memory available for the redpanda process.
-
Clock drift: The ntp clock delta (using pool.ntp.org as a reference) and round trip time.
-
Admin API calls: Cluster and broker configurations, cluster health data, CPU profiles, and license key information.
-
Broker metrics: The broker’s Prometheus metrics, fetched through its admin API (/metrics and /public_metrics).
Bare-metal
-
Kernel: The kernel logs ring buffer (syslog) and parameters (sysctl).
-
DNS: The DNS info as reported by 'dig', using the hosts in /etc/resolv.conf.
-
Disk usage: The disk usage for the data directory, as output by 'du'.
-
Redpanda logs: The broker’s Redpanda logs written to
journaldsinceyesterday(00:00:00 of the previous day based onsystemd.time). If--logs-sinceor--logs-untilis passed, only the logs within the resulting time frame are included. -
Socket info: The active sockets data output by 'ss'.
-
Running process info: As reported by 'top'.
-
Virtual memory stats: As reported by 'vmstat'.
-
Network config: As reported by 'ip addr'.
-
lspci: List the PCI buses and the devices connected to them.
-
dmidecode: The DMI table contents. Only included if this command is run as root.
Extra requests for partitions
You can provide a list of partitions to save additional admin API requests specifically for those partitions.
The partition flag accepts the format [namespace/]topic/partition[,partition…] where the namespace is optional. If the namespace is not provided, rpk will assume 'kafka'. For example:
Topic 'foo', partitions 1, 2 and 3:
--partition foo/1,2,3
Namespace _redpanda-internal, topic 'bar', partition 2:
--partition _redpanda-internal/bar/2
If you have an upload URL from the Redpanda support team, provide it in the --upload-url flag to upload your diagnostics bundle to Redpanda.
Kubernetes
-
Kubernetes Resources: Kubernetes manifests for all resources in the given Kubernetes namespace using
--namespace, or the shorthand version-n. -
redpanda logs: Logs of each Pod in the given Kubernetes namespace. If
--logs-sinceis passed, only the logs within the given timeframe are included.
Flags
| Value | Type | Description |
|---|---|---|
|
string |
The size limit of the controller logs that can be stored in the bundle. For example: 3MB, 1GiB. |
|
duration |
How long to collect samples for the CPU profiler. For example: 30s, 1.5m. Must be higher than 15s. |
|
int |
The maximum number of Kafka connections to store in the bundle. |
|
stringArray |
Comma-separated label selectors to filter your resources. For example: <label>=<value>,<label>=<value> (K8s only). |
|
string |
Include logs dated from specified date onward; (journalctl date format: YYYY-MM-DD, |
|
string |
Read the logs until the given size is reached. For example: 3MB, 1GiB. |
|
string |
Include logs older than the specified date; (journalctl date format: YYYY-MM-DD, |
|
duration |
Interval between metrics snapshots. For example: 30s, 1.5m. |
|
int |
Number of metrics samples to take (at the interval of |
|
string |
The namespace to use to collect the resources from (K8s only). |
|
string |
The file path where the debug file will be written (default ./<timestamp>-bundle.zip). |
|
stringArray |
Comma-separated partition IDs. When provided, |
|
duration |
How long to wait for child commands to execute. For example: 30s, 1.5m. |
|
string |
If provided, where to upload the bundle in addition to creating a copy on disk. |
Global flags
| Value | Type | Description |
|---|---|---|
|
string |
Redpanda or |
|
stringArray |
Override |
|
bool |
Ignore |
|
string |
|
|
bool |
Enable verbose logging. |
Result
The files and directories in the diagnostics bundle differ depending on the environment in which Redpanda is running.
-
Linux
-
Kubernetes
| File or Directory | Description |
|---|---|
|
Cluster and broker configurations, cluster health data, and license key information. |
|
Binary-encoded replicated logs that contain the history of configuration changes as well as internal settings. |
|
Metadata for the Redpanda data directory of the broker on which the |
|
Kafka metadata, such as broker configuration, topic configuration, offsets, groups, and group commits. |
|
Redpanda logs for the broker. |
|
Prometheus metrics from both the |
|
CPU details of the broker on which the |
|
The Redpanda configuration file of the broker on which the |
|
Redpanda resource usage data, such as CPU usage and free memory available. |
|
Data from the node on which the broker is running. This directory includes:
|
| File or Directory | Description |
|---|---|
|
Cluster and broker configurations, cluster health data, and license key information. |
|
Binary-encoded replicated logs that contain the history of configuration changes as well as internal settings. |
|
Metadata for the Redpanda data directory of the broker on which the |
|
Kafka metadata, such as broker configuration, topic configuration, offsets, groups, and group commits. |
|
Redpanda logs for the broker. |
|
Prometheus metrics from both the |
|
CPU details of the broker on which the |
|
The Redpanda configuration file of the broker on which the |
|
Redpanda resource usage data, such as CPU usage and free memory available. |
|
Data from the node on which the broker is running. This directory includes:
|
Examples
This section provides examples of how to use rpk debug bundle.
Collect Redpanda logs from a specific timeframe.
rpk debug bundle --logs-since "2022-02-01" --logs-size-limit 3MiB
Use a custom Kubernetes namespace.
rpk debug bundle --namespace <namespace>