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

nomad operator debug - add client node filtering arguments #9331

Merged
merged 7 commits into from
Nov 12, 2020

Conversation

davemay99
Copy link
Contributor

Adds max-nodes, node-id=all, and node-class cmdline arguments to nomad operator debug

From the helpText:

  -max-nodes=<count>
    Cap the maximum number of client nodes included in the capture.  Defaults to 10, set to 0 for unlimited.

  -node-id=<node>,<node>
    Comma separated list of Nomad client node ids, to monitor for logs and include pprof
    profiles. Accepts id prefixes, and "all" to select all nodes (up to count = max-nodes).

  -node-class=<node-class>
    Filter client nodes based on node class.

@davemay99 davemay99 requested review from schmichael and drewbailey and removed request for schmichael November 11, 2020 23:39
@@ -69,9 +71,15 @@ Debug Options:
-log-level=<level>
The log level to monitor. Defaults to DEBUG.

-max-nodes=<count>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to see if there is any precedent for having unlimited be -1, so that you can actually specify 0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't specify -node-id then -max-nodes doesn't apply. In testing though I discovered that the max node count notice is incorrectly displayed in that case.


// Create the output directory
var tmp string
if output != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

squinting at this block of code seems like it may be a nice candidate to pull out to a function, not a blocker though. I am curious why we defer removing the tmp directory? is it copied or moved somewhere down the road?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is to ensure that the temp directory is cleaned up before exit, regardless of any errors that may occur.

In local testing I have code that uses the NOMAD_TEST_SKIPCLEANUP environment variable to conditionally clean up (idea lifted from the E2E framework). If you think it's useful I can commit that as well.

Copy link
Contributor

@drewbailey drewbailey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changes look good to me, don't forget a changelog entry and also the website/ docs need to be updated with the new flags

@davemay99 davemay99 merged commit 205b0e7 into master Nov 12, 2020
@davemay99 davemay99 deleted the f-debug-node-selection branch November 12, 2020 16:25
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants