Repository navigation
mgr/cephadm: Control cephadm.log messages based on a mgr logging flag - #67300
ashjosh1git wants to merge 3 commits into
Conversation
…level flag Fixes: https://tracker.ceph.com/issues/74872 Signed-off-by: Ashwin M. Joshi <[email protected]>
|
Can one of the admins verify this patch? |
13 similar comments
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
|
Can one of the admins verify this patch? |
adk3798
left a comment
There was a problem hiding this comment.
Seems to be going in the right direction. We will need to test for commands the cephadm mgr module calls to the binary where it expects to get info back (e.g. cephadm ls, cephadm ceph-volume inventory) still give us back the correct info in the case we log at a higher level. I think they should, but something that needs to be checked.
…level flag Fixes: https://tracker.ceph.com/issues/74872 Signed-off-by: Ashwin M. Joshi <[email protected]>
ashjosh1git
left a comment
There was a problem hiding this comment.
Comments incorporated, please review
rkachach
left a comment
There was a problem hiding this comment.
Changes mostly LGTM but I'm worried about using debug as default. Normally in production defaults should be error (or at most info) and debugging should only be switched on when needed.
There was a problem hiding this comment.
Pull request overview
This PR introduces a configurable logging verbosity level for the cephadm binary when invoked remotely by the mgr/cephadm orchestrator, with the goal of reducing noisy host-status / host-check output.
Changes:
- Add a new mgr module option
mgr/cephadm/cephadm_binary_logging_leveland plumb it into remotecephadminvocations as--logging-level. - Extend the
cephadmCLI to accept--logging-leveland wire it into cephadm’s logging initialization. - Add a cephadm mgr unit test asserting that
check-hostis invoked with the configured--logging-level.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pybind/mgr/cephadm/module.py | Adds the new mgr option and a type-checking default attribute for it. |
| src/pybind/mgr/cephadm/serve.py | Appends --logging-level <level> to remote cephadm command invocations. |
| src/cephadm/cephadm.py | Adds --logging-level as a global cephadm CLI argument. |
| src/cephadm/cephadmlib/context.py | Adds logging_level to the cephadm context so argparse can populate it. |
| src/cephadm/cephadmlib/logging.py | Attempts to apply logging_level to cephadm’s logging config and gate command-line debug output. |
| src/pybind/mgr/cephadm/tests/test_cephadm.py | Adds a test verifying the mgr passes --logging-level to cephadm check-host. |
You can also share your feedback on Copilot code review. Take the survey.
| class TestCephadmBinaryLoggingLevel: | ||
| """Test that host-status / cephadm binary logs are suppressed based on | ||
| mgr/cephadm/cephadm_binary_logging_level. | ||
| """ | ||
| @pytest.mark.parametrize("logging_level", ['info', 'debug', 'error', 'warning']) | ||
| @mock.patch("cephadm.ssh.SSHManager._remote_connection") | ||
| @mock.patch("cephadm.ssh.SSHManager._execute_command") | ||
| @mock.patch("cephadm.ssh.SSHManager._check_execute_command") | ||
| def test_check_host_invokes_cephadm_with_logging_level( | ||
| self, check_execute_command, execute_command, remote_connection, cephadm_module, logging_level | ||
| ): | ||
| """Cephadm binary must be invoked with --logging-level matching | ||
| mgr/cephadm/cephadm_binary_logging_level (info, debug, error, warning). | ||
| Check that mgr builds the cephadm command with appropriate --logging-level flag | ||
| Use check-host as a sample command although all cephadm commands receive the flag. | ||
| """ |
There was a problem hiding this comment.
The class/docstring claims to test that cephadm binary logs are “suppressed”, but the assertions only verify that --logging-level is present in the constructed command. Either adjust the docstring/test name to match what’s actually being asserted, or extend the test to validate the behavioral effect (reduced stderr/log output) so the test covers the intended suppression semantics.
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
#68859 takes this PR further. |
Makes sense. This can be taken in a staged manner since which of the existing default debug logging can be converted to info needs a separate consideration. #68859 takes this PR forward to add infra to control the repetitive logging. |
User wants to disable the host check-hosts, or gather-facts logs that is being captured every minute in the cephadm.log file. The existing mgr flag mgr/cephadm/log_to_cluster_level does not control the logging by cephadm binary. This patch adds a new mgr flag cephadm_binary_logging_level to control the logging in cephadm.log. The default behaviour would have 'debug' level set, and the repetative messages can be turned off by setting mgr/cephadm/cephadm_binary_logging_level to 'info'. The cephadm_binary_logging_level logging level applies to all cephadm binary invocations by mgr.
Fixes: https://tracker.ceph.com/issues/74872
Signed-off-by: Ashwin M. Joshi [email protected]
And with higher logging levels
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.