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

NET-4519 Collecting journald logs in "consul debug" bundle (#18797) #18884

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

absolutelightning
Copy link
Contributor

Backport

This PR is auto-generated from #18797 to be assessed for backporting due to the inclusion of the label backport/1.16.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@absolutelightning
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: POST https://api.github.com/repos/hashicorp/consul/merges: 409 Merge conflict []

The below text is copied from the body of the original PR.


Description

Fixes NET-4519 Collecting journald logs in "consul debug" bundle.
Adds a flag to consul debug command named -since. It accepts go time duration.
Internally hcdiag is called with args - -consul and -since=since.

Testing & Reproduction steps

make dev
./bin/consul debug -since 1m

asheshvidyut@asheshvidyut-H2GX766V9T ~/consul (NET-4519 %) » ./bin/consul debug -since 1m
==> Starting debugger and capturing static information...
     Agent Version: '1.17.0'
2023-09-14T17:09:09.532+0530 [INFO]  hcdiag: Ensuring destination directory exists: directory=.
2023-09-14T17:09:09.532+0530 [INFO]  hcdiag: Checking product availability
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag: Gathering diagnostics
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: Running operations for: product=host
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: product=host runner="do host"
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: Running operations for: product=consul
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: product=consul runner="do consul"
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag: running operation: runner="consul version"
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag: running operation: runner="consul operator raft list-peers -stale=true"
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner="uname -v"
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=disks
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=info
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=memory
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=process
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=network
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=iptables
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=/etc/hosts
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner="/proc/ files"
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag.product: running operation: runner=/etc/fstab
2023-09-14T17:09:09.609+0530 [INFO]  hcdiag: running operation: runner=ConsulDebug
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/agent/self"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/agent/metrics"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/catalog/datacenters"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/catalog/services"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/namespace"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/status/leader"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/status/peers"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="GET /v1/agent/members?cached"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner="log/docker consul"
2023-09-14T17:09:09.611+0530 [INFO]  hcdiag: running operation: runner=journald
2023-09-14T17:09:09.651+0530 [INFO]  hcdiag: Product done: product=host statuses="map[skip:3 success:8]"
2023-09-14T17:09:21.734+0530 [INFO]  hcdiag: Product done: product=consul statuses="map[skip:2 success:10 unknown:2]"
2023-09-14T17:09:21.734+0530 [INFO]  hcdiag: Recording manifest
2023-09-14T17:09:21.736+0530 [INFO]  hcdiag: Created results.json file: dest=/Users/asheshvidyut/consul/hcdiag-2023-09-14T113909Z2967109506/results.json
2023-09-14T17:09:21.737+0530 [INFO]  hcdiag: Created manifest.json file: dest=/Users/asheshvidyut/consul/hcdiag-2023-09-14T113909Z2967109506/manifest.json
2023-09-14T17:09:21.745+0530 [INFO]  hcdiag: Compressed and archived output file: dest=hcdiag-2023-09-14T113909Z.tar.gz
The diagnostic run has completed. The results bundle can be found at hcdiag-2023-09-14T113909Z.tar.gz.
product  success  fail  skip  canceled  timeout  unknown  total
consul   10       0     2     0         0        2        14
host     8        0     3     0         0        0        11

PR Checklist

  • updated test coverage
  • external facing docs updated
  • appropriate backport labels added
  • not a security concern

Overview of commits

* debug since

* fix docs

* chagelog added

* fix go mod

* debug test fix

* fix test

* tabs test fix

* Update .changelog/18797.txt

Co-authored-by: Ganesh S <ganesh.seetharaman@hashicorp.com>

---------

Co-authored-by: Ganesh S <ganesh.seetharaman@hashicorp.com>
@absolutelightning absolutelightning requested a review from a team as a code owner September 19, 2023 10:38
@github-actions github-actions bot added type/docs Documentation needs to be created/updated/clarified theme/cli Flags and documentation for the CLI interface pr/dependencies PR specifically updates dependencies of project labels Sep 19, 2023
@absolutelightning absolutelightning merged commit 5e7693b into release/1.16.x Sep 19, 2023
84 of 85 checks passed
@absolutelightning absolutelightning deleted the backport-NET-4519-1.16.x branch September 19, 2023 12:07
@absolutelightning absolutelightning added the consul-india PRs/Issues assigned to Consul India team label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india PRs/Issues assigned to Consul India team pr/dependencies PR specifically updates dependencies of project pr/no-backport theme/cli Flags and documentation for the CLI interface type/docs Documentation needs to be created/updated/clarified
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants