pkg/cli: add tenant ID filter flag to debug merge-logs
#95016
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NB: Only review the final commit - all previous commits are being reviewed in #94777
With multiple tenants running per-process, log files are
shared between tenants where tenant ID tags are used to
distinguish which tenant a log entry originated from.
When dealing with logs, especially in a debug.zip bundle,
we need to provide tools that make it easy to filter logs
to a specific tenant, or group of tenants.
This patch updates the
debug merge-logs
command with a--tenant-ids
flag which can be used to filter mergedlogs to specific tenant ID(s). For example, to only include
logs for app tenants 2 and 3:
Release note (cli change): The
debug merge-logs
CLI command is now equipped with a
--tenant-ids
flag, which can be used to provide the command with
a list of tenant IDs to filter logs on. For example,
to only include logs for secondary tenants 2 and 3:
Note that when processing logs from older cluster
versions, where a tenant ID tag may not be present
on the log entry, the command will interpret any
log without a tenant ID as belonging to the system
tenant (tenant ID = 1).
Epic: CRDB-14486
Addresses: https://cockroachlabs.atlassian.net/browse/CRDB-22152