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

Backport of [NET-4107][Supportability] Log Level set to TRACE and duration set to 5m for consul-debug into release/1.15.x #17727

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/17596.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
debug: change default setting of consul debug command. now default duration is 5ms and default log level is 'TRACE'
```
4 changes: 2 additions & 2 deletions command/debug/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const (

// debugDuration is the total duration that debug runs before being
// shut down
debugDuration = 2 * time.Minute
debugDuration = 5 * time.Minute

// debugDurationGrace is a period of time added to the specified
// duration to allow intervals to capture within that time
Expand Down Expand Up @@ -500,7 +500,7 @@ func (c *cmd) captureHeap(outputDir string) error {
}

func (c *cmd) captureLogs(ctx context.Context) error {
logCh, err := c.client.Agent().Monitor("DEBUG", ctx.Done(), nil)
logCh, err := c.client.Agent().Monitor("TRACE", ctx.Done(), nil)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions website/content/commands/debug.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ or otherwise.
`Usage: consul debug [options]`

By default, the debug command will capture an archive at the current path for
all targets for 2 minutes.
all targets for 5 minutes.

#### Command Options

- `-duration` - Optional, the total time to capture data for from the target agent. Must
be greater than the interval and longer than 10 seconds. Defaults to 2 minutes.
be greater than the interval and longer than 10 seconds. Defaults to 5 minutes.

- `-interval` - Optional, the interval at which to capture dynamic data, such as heap
and metrics. Must be longer than 5 seconds. Defaults to 30 seconds.
Expand Down Expand Up @@ -79,7 +79,7 @@ information when `debug` is running. By default, it captures all information.
| `host` | Information about resources on the host running the target agent such as CPU, memory, and disk. |
| `members` | A list of all the WAN and LAN members in the cluster. |
| `metrics` | Metrics from the in-memory metrics endpoint in the target, captured at the interval. |
| `logs` | `DEBUG` level logs for the target agent, captured for the duration. |
| `logs` | `TRACE` level logs for the target agent, captured for the duration. |
| `pprof` | Golang heap, CPU, goroutine, and trace profiling. CPU and traces are captured for `duration` in a single file while heap and goroutine are separate snapshots for each `interval`. This information is not retrieved unless [`enable_debug`](/consul/docs/agent/config/config-files#enable_debug) is set to `true` on the target agent or ACLs are enable and an ACL token with `operator:read` is provided. |

## Examples
Expand Down