-
Notifications
You must be signed in to change notification settings - Fork 58
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
drenv: Improve gather logs #1748
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Closed
nirs
force-pushed
the
gather-logs
branch
8 times, most recently
from
January 15, 2025 21:44
ae86c28
to
1e024de
Compare
nirs
commented
Jan 27, 2025
parikshithb
reviewed
Jan 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, minor comment.
Update the install instructions to install the latest version on Linux and macOS, and add a note about required version (0.6.0). Signed-off-by: Nir Soffer <nsoffer@redhat.com>
The module parses and log JSON lines logged by programs using Go zap module. This is needed for logging kubectl-gather JSON logs, but can also be used with other tools, since zap is very popular. Signed-off-by: Nir Soffer <nsoffer@redhat.com>
nirs
force-pushed
the
gather-logs
branch
2 times, most recently
from
January 27, 2025 14:30
2d793c3
to
c80a217
Compare
We used to drop gather info logs. Watch the gather process and log the gather logs as they are written to stderr. Example logs with this change: % drenv gather envs/regional-dr.yaml 2025-01-15 22:04:20,865 INFO [rdr] Gathering environment 2025-01-15 22:04:21,124 INFO [gather] Using kubeconfig "/Users/nsoffer/.kube/config" 2025-01-15 22:04:21,126 INFO [gather] Gathering from all namespaces 2025-01-15 22:04:21,126 INFO [gather] Using all addons 2025-01-15 22:04:21,126 INFO [gather] Storing data in "gather.20250115220421" 2025-01-15 22:04:21,126 INFO [gather] Gathering from cluster "dr1" 2025-01-15 22:04:21,126 INFO [gather] Gathering from cluster "dr2" 2025-01-15 22:04:21,126 INFO [gather] Gathering from cluster "hub" 2025-01-15 22:04:23,095 INFO [gather] Gathered 1535 resources from cluster "hub" in 1.969 seconds 2025-01-15 22:04:24,395 INFO [gather] Gathered 1909 resources from cluster "dr1" in 3.269 seconds 2025-01-15 22:04:24,544 INFO [gather] Gathered 1920 resources from cluster "dr2" in 3.417 seconds 2025-01-15 22:04:24,544 INFO [gather] Gathered 5364 resources from 3 clusters in 3.418 seconds 2025-01-15 22:04:24,555 INFO [rdr] Environment gathered in 3.69 seconds Note: This change requires kubectl-gather 0.6.0. Developers that want to use the `drenv gather` command will have to upgrade kubectl-gather to latest version. Signed-off-by: Nir Soffer <nsoffer@redhat.com>
If drenv is run in verbose mode, pass --verbose flag to kubectl-gather to log more verbose gather logs. This may be useful to debug issues in kubectl gather in the CI environment. Example log with this change: % drenv gather envs/regional-dr.yaml -v 2025-01-15 22:13:31,064 DEBUG [envfile] Detected os: 'darwin' 2025-01-15 22:13:31,064 DEBUG [envfile] Detected machine: 'arm64' 2025-01-15 22:13:31,064 DEBUG [envfile] Using provider: 'lima' 2025-01-15 22:13:31,064 DEBUG [envfile] Using driver: '' 2025-01-15 22:13:31,064 DEBUG [envfile] Using network: '' 2025-01-15 22:13:31,064 DEBUG [envfile] Detected os: 'darwin' 2025-01-15 22:13:31,064 DEBUG [envfile] Detected machine: 'arm64' 2025-01-15 22:13:31,064 DEBUG [envfile] Using provider: 'lima' 2025-01-15 22:13:31,064 DEBUG [envfile] Using driver: '' 2025-01-15 22:13:31,064 DEBUG [envfile] Using network: '' 2025-01-15 22:13:31,064 DEBUG [envfile] Detected os: 'darwin' 2025-01-15 22:13:31,064 DEBUG [envfile] Detected machine: 'arm64' 2025-01-15 22:13:31,064 DEBUG [envfile] Using provider: 'lima' 2025-01-15 22:13:31,064 DEBUG [envfile] Using driver: '' 2025-01-15 22:13:31,064 DEBUG [envfile] Using network: '' 2025-01-15 22:13:31,064 INFO [rdr] Gathering environment 2025-01-15 22:13:31,356 INFO [gather] Using kubeconfig "/Users/nsoffer/.kube/config" 2025-01-15 22:13:31,359 INFO [gather] Gathering from all namespaces 2025-01-15 22:13:31,359 INFO [gather] Using all addons 2025-01-15 22:13:31,359 INFO [gather] Storing data in "gather.20250115221331" 2025-01-15 22:13:31,359 INFO [gather] Gathering from cluster "dr1" 2025-01-15 22:13:31,359 INFO [gather] Gathering from cluster "dr2" 2025-01-15 22:13:31,359 INFO [gather] Gathering from cluster "hub" 2025-01-15 22:13:31,406 DEBUG [gather.dr2] Listed 133 api resources in 0.038 seconds 2025-01-15 22:13:31,406 DEBUG [gather.hub] Listed 105 api resources in 0.038 seconds 2025-01-15 22:13:31,410 DEBUG [gather.dr1] Listed 133 api resources in 0.042 seconds 2025-01-15 22:13:31,416 DEBUG [gather.dr2] Listed 0 "podtemplates" in 0.010 seconds 2025-01-15 22:13:31,416 DEBUG [gather.dr2] Gathered 0 "podtemplates" in 0.010 seconds Signed-off-by: Nir Soffer <nsoffer@redhat.com>
parikshithb
approved these changes
Jan 29, 2025
rakeshgm
approved these changes
Jan 29, 2025
Thanks for reviwing! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We used to drop gather info logs. Watch the gather process and log the
gather logs as they are written to stderr.
If drenv is run with --verbose we pass the option to kubectl-gather to log
more verbose logs. This may help to debug issues in kubect-gather in the CI
environment.
Example logs with this change:
Note: This change requires kubectl-gather 0.6.0. Developers that want to
use the
drenv gather
command will have to upgrade kubectl-gather tolatest version.