debug: update default node-id and docs (#11398)

* debug: default node-id to all
* debug: align cli help and website documentation
This commit is contained in:
Dave May
2021-10-27 13:43:56 -04:00
committed by GitHub
parent 3ce89b75f4
commit f46b97b2df
3 changed files with 28 additions and 19 deletions

View File

@@ -134,7 +134,8 @@ Vault Options:
Debug Options:
-duration=<duration>
The duration of the log monitor command. Defaults to 2m.
Set the duration of the debug capture. Logs will be captured from specified servers and
nodes at "log-level". Defaults to 2m.
-interval=<interval>
The interval between snapshots of the Nomad state. Set interval equal to
@@ -147,7 +148,7 @@ Debug Options:
Cap the maximum number of client nodes included in the capture. Defaults
to 10, set to 0 for unlimited.
-node-id=<node>,<node>
-node-id=<node1>,<node2>
Comma separated list of Nomad client node ids to monitor for logs, API
outputs, and pprof profiles. Accepts id prefixes, and "all" to select all
nodes (up to count = max-nodes). Defaults to "all".
@@ -158,7 +159,7 @@ Debug Options:
-pprof-duration=<duration>
Duration for pprof collection. Defaults to 1s.
-server-id=<server>,<server>
-server-id=<server1>,<server2>
Comma separated list of Nomad server names to monitor for logs, API
outputs, and pprof profiles. Accepts server names, "leader", or "all".
Defaults to "all".
@@ -169,8 +170,8 @@ Debug Options:
necessary to get the configuration from a non-leader server.
-output=<path>
Path to the parent directory of the output directory. If not specified, an
archive is built in the current directory.
Path to the parent directory of the output directory. If specified, no
archive is built. Defaults to the current directory.
`
return strings.TrimSpace(helpText)
}
@@ -287,7 +288,7 @@ func (c *OperatorDebugCommand) Run(args []string) int {
flags.StringVar(&c.logLevel, "log-level", "DEBUG", "")
flags.IntVar(&c.maxNodes, "max-nodes", 10, "")
flags.StringVar(&c.nodeClass, "node-class", "", "")
flags.StringVar(&nodeIDs, "node-id", "", "")
flags.StringVar(&nodeIDs, "node-id", "all", "")
flags.StringVar(&serverIDs, "server-id", "all", "")
flags.BoolVar(&c.stale, "stale", false, "")
flags.StringVar(&output, "output", "", "")
@@ -450,8 +451,13 @@ func (c *OperatorDebugCommand) Run(args []string) int {
// Return error if nodes were specified but none were found
if len(nodeIDs) > 0 && nodeCaptureCount == 0 {
c.Ui.Error(fmt.Sprintf("Failed to retrieve clients, 0 nodes found in list: %s", nodeIDs))
return 1
if nodeIDs == "all" {
// It's okay to have zero clients for default "all"
c.Ui.Info("Note: \"-node-id=all\" specified but no clients found")
} else {
c.Ui.Error(fmt.Sprintf("Failed to retrieve clients, 0 nodes found in list: %s", nodeIDs))
return 1
}
}
// Resolve servers