Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pkg/cli: add tenant ID filter flag to debug merge-logs #95016

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

abarganier
Copy link
Contributor

@abarganier abarganier commented Jan 10, 2023

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 merged
logs to specific tenant ID(s). For example, to only include
logs for app tenants 2 and 3:

cockroach debug merge-logs ... --tenant-ids=2,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:

cockroach debug merge-logs ... --tenant-ids=2,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

@abarganier abarganier requested review from dhartunian, aadityasondhi and a team January 10, 2023 20:28
@abarganier abarganier requested review from a team as code owners January 10, 2023 20:28
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@abarganier abarganier force-pushed the merge-logs-tenant-filter branch from d5aa17f to f46c789 Compare January 10, 2023 21:20
Copy link
Collaborator

@dhartunian dhartunian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, 2 of 2 files at r2, 31 of 31 files at r3.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aadityasondhi)

@abarganier abarganier force-pushed the merge-logs-tenant-filter branch 2 times, most recently from 5b759d8 to 0885f22 Compare January 12, 2023 19:47
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 merged
logs to specific tenant ID(s). For example, to only include
logs for app tenants 2 and 3:

```
cockroach debug merge-logs ... --tenant-ids=2,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:

```
cockroach debug merge-logs ... --tenant-ids=2,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).
@abarganier abarganier force-pushed the merge-logs-tenant-filter branch from 0885f22 to 0195831 Compare January 12, 2023 22:03
@abarganier
Copy link
Contributor Author

bors r=dhartunian

@craig
Copy link
Contributor

craig bot commented Jan 13, 2023

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Jan 13, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants