-
Notifications
You must be signed in to change notification settings - Fork 579
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
Object triggered verbose logging #7912
Comments
Implementation idea:
|
@julianbrost What about this one for e.g. 2.15? Just thought about this during work on a ticket from a customer with a probably large environment about a single checkable. I guess this feature would help us with debugging in the first place. |
I mean if you're building something that's useful and reusable anyways, make it a PR and we can look at it. But the proposal in #7912 (comment) sounds like an invitation for performance issues. Graph lookups and DSL function calls for every potential debug log message sounds really expensive. |
I don't have anything in stash, don't worry. But the earlier we put this on rails, the earlier (or probably not) customers won't have to worry about excessive debug log 🪵 I/O just for providing us some info about object X.
OK, forget about the DSL. Let's just imagine every object has a log level attribute. Every message of this level (e.g. notice) or higher (info, warn, ...) affecting the object (in)directly is logged despite logger's level. Actually the "graph" is just a big parent<->child map. It can be shared-locked if not already done. And the log levels in question can be cached like: Oh, a debug message, but there are 0 objects with that level, so nothing to look up in the graph anyway. Apropos lookup, this would be like: For each supplied involved object (usually one or two) get all parents (e.g. for notification: its service, its host, its host group), get their log levels, compute the most verbose one. Does this sound like a plan? |
Extreme write pressure to the storage system is another kind of expensive. |
@julianbrost Also in 2.14 we've forbidden runtime updates to relationship attributes. This enables caching of all parents per object according to the graph from object creation during its whole lifetime. |
@julianbrost In #9844 you've put up the question about the destination of such privileged log messages. 💡 What about instead (of that whole concept) letting every logger optionally define a set of involved object types and names of objects to limit itself to? E.g. on our behalf a customer API-creates/deletes (ciao reload!) a FileLogger with debug level, but a specification like "Host" => "dns1.netways.de". That logger will log only stuff related* to dns1.netways.de. * Implementation detail |
You mean something like that?
So if there was no such logger with |
Is your feature request related to a problem? Please describe.
In trying to debug configurations, and possibly Icinga2, it is common to advise that debug mode be turned on. However our system logs 5 to 10MB a minute, so it is impractical to leave it on overnight. I can turn it on and off, but it is difficult to catch the events in question, and to wade through all the logging not relevant to my issue.
Describe the solution you'd like
I would like to flag a particular object (e.g. Host, Notification, Service) and log just interactions with that object, including the chain of other objects. For example if I flag a Host object, if it is involved in a parent dependency, log that, if it has a Service that goes soft and hard, log that, and that service notifies, log that.
If I flag a Service, log soft and hard state and notifications or invoking a dependency, but not everything else that involves the parent Host.
Describe alternatives you've considered
There's turning it on and off as mentioned above.
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: