-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Do not spawn logmon if user wants to collect/ship log via other tools #11175
Comments
Hi @towe75 👋 This sounds like an useful option. I will bring up with the rest of the team and let you know 🙂 |
After checking with the rest of the team we think this would be a nice feature to have 🙂 Per-task config sounds good. One idea that was brought up was to potentially have a plugin-level config, perhaps adding a new capability so it becomes a generic mechanism for plugins to tell Nomad that logging is disabled.
Thank you ❤️ Let us know if you have any questions! |
I don't want to clog the discussion, but since there are not many comments indicating that this feature is awaited I want to add my +1 for its demand. Looks like it won't be super-hard to implement. |
Any thoughts on configuration properties? Can i go with logs { max_files=0 } or is it better to add a new bool property. IMHO max_files=0 is not so bad because it makes it explicit that Nomad will no longer consume or rotate the logs. |
To my mind logs {
enabled = false
} for a task and not bother with any other options of this stanza. |
I think I would lean towards Another small technical detail with using To work around this, we use pointers so we can have Using |
I spent some time on this issue and went for the Enabled=false approach. It was simple to not start/stop logmon based on the new config entry. Flipping the option and updating the job is another story. I am unsure how to implement it - it's my first core contribution. Can we maybe enforce a alloc restart in the case that the logger is enabled/disabled? It would surely simplify the lifecycle management for logmon. Also we have to decide what to present to the actual task executor instead of the fifo files. For non-windows we could use /dev/null, maybe. @lgfa29 can you give me some advice? |
Pushed a draft now, see #11415 |
Hello, |
One more note from my side, which I didn't realise prior to looking into the code (which you definitely already aware of). There's really a driver's config (as part of the If there aren't concerns for implementing it for other drivers, then it'd be nice to have it as well. Thus we'll allow 2 levels of enabling/disabling logmon: It should be addressed in a separate issue, of course :) |
Some Nomad users ship application logs out-of-band via syslog. For these users having `logmon` (and `docker_logger`) running is unnecessary overhead. Allow disabling the logmon and pointing the task's stdout/stderr to /dev/null. This changeset is the first of several incremental improvements to log collection short of full-on logging plugins. The next step will likely be to extend the internal-only task driver configuration so that cluster administrators can turn off log collection for the entire driver. --- Fixes: #11175 Co-authored-By: Thomas Weber <[email protected]>
Some Nomad users ship application logs out-of-band via syslog. For these users having `logmon` (and `docker_logger`) running is unnecessary overhead. Allow disabling the logmon and pointing the task's stdout/stderr to /dev/null. This changeset is the first of several incremental improvements to log collection short of full-on logging plugins. The next step will likely be to extend the internal-only task driver configuration so that cluster administrators can turn off log collection for the entire driver. --- Fixes: #11175 Co-authored-by: Thomas Weber <[email protected]>
I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues. |
Proposal
As a nomad user i want to be able to have full control over my log files. I do not want to be forced to waste resources by running a idle "nomad logmon" process for each of my tasks.
Use-cases
Sometimes we want to use promtail or another log aggregator to ship logs to a central server. For some users it might even be enough to examine the local journal. In such cases it's quite some overhead to manage dual-logging incl. rotation etc.
I'm not arguing against the nomad'isch way of logging - it's very nice for some cases but the user should have a choice.
There seems to be no generic way to accomplish this by configuration means right now. Only the docker driver has a explicit "disable_log_collection" option. It's not possible for external driver plugins, like https://github.com/hashicorp/nomad-driver-podman , to hook into this mechanism AFAIK (experimental internal driver capabilities).
Also it might be desired to enable/disable log collection per task.
What about extending the existing logs stanza with e.g. a "Enabled = false" attribute. Alternatively we could also interpret a magic logs.max_files=0 value.
A optimal solution should respect the setting also in ui/cli instead of simply showing an empty tab etc.
I'm willing to contribute a PR if we can get to some conclusion here.
The text was updated successfully, but these errors were encountered: