consul/website/content/commands
Dhia Ayachi 3717ab0991 generate a single debug file for a long duration capture (#10279)
* debug: remove the CLI check for debug_enabled

The API allows collecting profiles even debug_enabled=false as long as
ACLs are enabled. Remove this check from the CLI so that users do not
need to set debug_enabled=true for no reason.

Also:
- fix the API client to return errors on non-200 status codes for debug
  endpoints
- improve the failure messages when pprof data can not be collected

Co-Authored-By: Dhia Ayachi <dhia@hashicorp.com>

* remove parallel test runs

parallel runs create a race condition that fail the debug tests

* snapshot the timestamp at the beginning of the capture

- timestamp used to create the capture sub folder is snapshot only at the beginning of the capture and reused for subsequent captures
- capture append to the file if it already exist

* Revert "snapshot the timestamp at the beginning of the capture"

This reverts commit c2d03346

* Refactor captureDynamic to extract capture logic for each item in a different func

* snapshot the timestamp at the beginning of the capture

- timestamp used to create the capture sub folder is snapshot only at the beginning of the capture and reused for subsequent captures
- capture append to the file if it already exist

* Revert "snapshot the timestamp at the beginning of the capture"

This reverts commit c2d03346

* Refactor captureDynamic to extract capture logic for each item in a different func

* extract wait group outside the go routine to avoid a race condition

* capture pprof in a separate go routine

* perform a single capture for pprof data for the whole duration

* add missing vendor dependency

* add a change log and fix documentation to reflect the change

* create function for timestamp dir creation and simplify error handling

* use error groups and ticker to simplify interval capture loop

* Logs, profile and traces are captured for the full duration. Metrics, Heap and Go routines are captured every interval

* refactor Logs capture routine and add log capture specific test

* improve error reporting when log test fail

* change test duration to 1s

* make time parsing in log line more robust

* refactor log time format in a const

* test on log line empty the earliest possible and return

Co-authored-by: Freddy <freddygv@users.noreply.github.com>

* rename function to captureShortLived

* more specific changelog

Co-authored-by: Paul Banks <banks@banksco.de>

* update documentation to reflect current implementation

* add test for behavior when invalid param is passed to the command

* fix argument line in test

* a more detailed description of the new behaviour

Co-authored-by: Paul Banks <banks@banksco.de>

* print success right after the capture is done

* remove an unnecessary error check

Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>

* upgraded github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57 => v0.0.0-20210601050228-01bbb1931b22

Co-authored-by: Daniel Nephin <dnephin@hashicorp.com>
Co-authored-by: Freddy <freddygv@users.noreply.github.com>
Co-authored-by: Paul Banks <banks@banksco.de>
2021-06-07 17:12:49 +00:00
..
acl Merge pull request #10325 from hashicorp/docs/clarify-acl-set-agent-token-persistence 2021-06-01 20:48:27 +00:00
catalog website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
config Merge pull request #10177 from hashicorp/dnephin/config-entry-remove-fields 2021-05-06 18:22:17 +00:00
connect connect: update supported envoy versions to 1.18.3, 1.17.3, 1.16.4, and 1.15.5 (#10231) 2021-05-12 19:06:43 +00:00
intention website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
kv website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
namespace website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
operator website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
services website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
snapshot Merge pull request #10336 from hashicorp/docs/licensing-updates 2021-06-03 14:51:28 +00:00
tls website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
agent.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
debug.mdx generate a single debug file for a long duration capture (#10279) 2021-06-07 17:12:49 +00:00
event.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
exec.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
force-leave.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
index.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
info.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
join.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
keygen.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
keyring.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
leave.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
license.mdx Add license inspect command documentation and changelog (#10351) 2021-06-04 18:33:53 +00:00
lock.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
login.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
logout.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
maint.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
members.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
monitor.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
reload.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
rtt.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
validate.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
version.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00
watch.mdx website: implement mktg 032 (#9953) 2021-04-07 15:50:38 -04:00