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 execute the rpk debug bundle command inside a container that’s running a Redpanda broker.

Usage

rpk debug bundle [flags]

Flags

Value Type Description

--admin-api-tls-cert

string

The certificate to be used for TLS authentication with the Admin API.

--admin-api-tls-enabled

-

Enable TLS for the Admin API (not necessary if specifying custom certs).

--admin-api-tls-key

string

The certificate key to be used for TLS authentication with the Admin API.

--admin-api-tls-truststore

string

The truststore to be used for TLS communication with the Admin API.

--api-urls

string

The address to the broker`s Admin API. Defaults to the one in the config file.

--brokers

strings

Comma-separated list of broker <ip>:<port> pairs, for example --brokers 192.168.78.34:9092,192.168.78.35:9092,192.179.23.54:9092. Alternatively, you may set the REDPANDA_BROKERS environment variable with the comma-separated list of broker addresses.

--config

string

Redpanda configuration file. If not set, rpk searches for the file in the default locations.

--controller-logs-size-limit

string

Sets the limit of the controller log size that can be stored in the bundle. Multipliers are also supported, e.g. 3MB, 1GiB (default "20MB").

-h, --help

-

Display documentation for rpk debug bundle.

--logs-since

string

Include log entries on or newer than the specified date in journalctl date format, for example YYYY-MM-DD.

--logs-size-limit

string

Read the logs until the given size is reached. Multipliers are also supported, e.g. 3MB, 1GiB (default "100MiB").

--logs-until

string

Include log entries on or older than the specified date in journalctl date format, for example YYYY-MM-DD.
Not supported in Kubernetes

--metrics-interval

duration

The amount of time to wait before capturing the second snapshot of the metrics endpoints, for example 30s (30 seconds) or 1.5m (90 seconds). This interval is useful because some metrics are counters that need values at two points in time. Default: 12s.
Kubernetes only

--namespace

string

The Kubernetes namespace in which the Redpanda cluster is running. Default: redpanda
Kubernetes only.

--password

string

SASL password to be used for authentication.

--sasl-mechanism

string

The authentication mechanism to use. Supported values: SCRAM-SHA-256 and SCRAM-SHA-512.

--timeout

duration

The amount of time to wait for child commands to execute, for example 30s (30 seconds) or 1.5m (90 seconds). Default: 10s.

--tls-cert

string

The certificate to be used for TLS authentication with the broker.

--tls-enabled

-

Enable TLS for the Kafka API (not necessary if specifying custom certs).

--tls-key

string

The certificate key to be used for TLS authentication with the broker.

--tls-truststore

string

The truststore to be used for TLS communication with the broker.

--upload-url

string

The URL to which to upload the diagnostics bundle. This URL is usually given to you by the Redpanda support team to help you debug your deployment.
Kubernetes only

--user

string

SASL user to be used for authentication.

-v, --verbose

-

Enable verbose logging. Default: false.

Result

The files and directories in the diagnostics bundle differ depending on the environment in which Redpanda is running.

  • Linux

  • Kubernetes

For some data, Redpanda requires the rpk debug bundle command to be run with root privileges. The names of the files or directories that are generated only with root privileges are labeled Requires root privileges.
File or Directory Description

data-dir.txt

Metadata for the Redpanda data directory of the broker on which the rpk debug bundle command was executed.

dig.txt

The DNS information, as output by the dig command, using the hosts in the /etc/resolv.conf file.

dmidecode.txt

The contents of the DMI table (system management BIOS or SMBIOS).
Requires root privileges

du.txt

The disk usage of the data directory of the broker on which the rpk debug bundle command was executed, as output by the du command.

ip.txt

Network configuration, as output by the ip addr command.

kafka.json

Kafka metadata, such as broker configuration, topic configuration, offsets, groups, and group commits.

lspci.txt

PCI buses and the devices connected to them.

ntp.txt

The NTP clock delta (using ntppool as a reference) and round trip time of the broker on which the rpk debug bundle command was executed.

/proc

CPU details of the broker on which the rpk debug bundle command was executed.
The directory includes a cpuinfo file with CPU information such as processor model, core count, cache size, and frequency, as well as an interrupts file that contains IRQ distribution across CPU cores.

redpanda.log

The Redpanda logs written to journald. If --logs-since and/or --logs-until are passed, then only the logs within the given timeframe are included.

prometheus-metrics.txt

The local broker’s Prometheus metrics, fetched through its admin API.

redpanda.yaml

The Redpanda configuration file of the broker on which the rpk debug bundle command was executed.<br/>Sensitive data is removed and replaced with (REDACTED).

resource-usage.json

Redpanda resource usage data, such as CPU usage and free memory available.

ss.txt

Data about active sockets, as output by the ss command.

syslog.txt

The kernel logs ring buffer, as output by the syslog command.

top.txt

Information about the running processes, as output by the top command.

Check system processes.

vmstat.txt

Redpanda collects some data from the Kubernetes API. To communicate with the Kubernetes API, Redpanda requires a ClusterRole attached to the default ServiceAccount for the Pods. The files and directories that are generated only when the ClusterRole exists are labeled Requires ClusterRole.
File or Directory Description

/admin

Cluster and broker configurations, cluster health data, and license key information.
Requires ClusterRole.

/controller

Binary-encoded replicated logs that contain the history of configuration changes as well as internal settings.
Redpanda can replay the events that took place in the cluster to arrive at a similar state.

data-dir.txt

Metadata for the Redpanda data directory of the broker on which the rpk debug bundle command was executed.

du.txt

The disk usage of the data directory of the broker on which the rpk debug bundle command was executed, as output by the du command.

/k8s

Kubernetes manifests for all resources in the given Kubernetes namespace.
Requires ClusterRole.

kafka.json

Kafka metadata, such as broker configuration, topic configuration, offsets, groups, and group commits.

/logs

Logs of each Pod in the given Kubernetes namespace.
If --logs-since is passed, only the logs within the given timeframe are included.
Requires ClusterRole.

/metrics

Prometheus metrics from both the /metrics endpoint and the public_metrics endpoint.
One directory for each broker’s metrics.
Requires ClusterRole.

ntp.txt

The NTP clock delta (using ntppool as a reference) and round trip time of the broker on which the rpk debug bundle command was executed.

/proc

CPU details of the broker on which the rpk debug bundle command was executed.
The directory includes a cpuinfo file with CPU information such as processor model, core count, cache size, frequency, as well as an interrupts file that contains IRQ distribution across CPU cores.

redpanda.yaml

The Redpanda configuration file of the broker on which the rpk debug bundle command was executed.
Sensitive data is removed and replaced with (REDACTED).

resource-usage.json

Redpanda resource usage data, such as CPU usage and free memory available.

Examples

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 redpanda-namespace