From b1febc638dd3ae5f469c3c301cb2188ddd77cc23 Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Sat, 17 Jun 2023 21:58:59 -0400 Subject: [PATCH] Backport of [NET-4107][Supportability] Log Level set to TRACE and duration set to 5m for consul-debug into release/1.14.x (#17729) * backport of commit 9d72a262f357ef0ee6409acae7d3c24d8f87caec * merged cherry picked commit --------- Co-authored-by: Ashesh Vidyut Co-authored-by: Ashesh Vidyut <134911583+absolutelightning@users.noreply.github.com> --- .changelog/17596.txt | 3 +++ command/debug/debug.go | 4 ++-- website/content/commands/debug.mdx | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 .changelog/17596.txt diff --git a/.changelog/17596.txt b/.changelog/17596.txt new file mode 100644 index 000000000000..1058df1ea3ab --- /dev/null +++ b/.changelog/17596.txt @@ -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' + ``` \ No newline at end of file diff --git a/command/debug/debug.go b/command/debug/debug.go index 017f42b77a2c..068052f69364 100644 --- a/command/debug/debug.go +++ b/command/debug/debug.go @@ -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 @@ -499,7 +499,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 } diff --git a/website/content/commands/debug.mdx b/website/content/commands/debug.mdx index 202fefd747cd..7402cf24c8a3 100644 --- a/website/content/commands/debug.mdx +++ b/website/content/commands/debug.mdx @@ -43,12 +43,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. @@ -77,7 +77,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`](/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