-
Notifications
You must be signed in to change notification settings - Fork 89
Add logVerbosity
Helm chart parameter, reduce default log verbosity
#633
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
base: main
Are you sure you want to change the base?
Add logVerbosity
Helm chart parameter, reduce default log verbosity
#633
Conversation
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
|
||
// Run invokes the IMEX daemon and manages its lifecycle. | ||
func run(ctx context.Context, cancel context.CancelFunc, flags *Flags) error { | ||
klog.Infof("config: %v", flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we are ok with the go-render route: then I want to apply that here, too
} | ||
|
||
// Run invokes the IMEX daemon and manages its lifecycle. | ||
func run(ctx context.Context, cancel context.CancelFunc, flags *Flags) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO, maybe in this PR, maybe in a follow-up: make the daemon consume the logVerbosity
parameter, too (and init klog
with that).
It's currently as noisy as before the patch in default config, containing e.g.
I0930 12:34:30.570186 1 round_trippers.go:632] "Response" verb="GET" url="https://10.96.0.1:443/apis/resource.nvidia.com/v1beta1/namespaces/default/computedomains?allowWatchBookmarks=true&fieldSelector=metadata.name%3Dimex-channel-injection-all&resourceVersion=21893750&timeout=7m41s&timeoutSeconds=461&watch=true" status="200 OK" milliseconds=1
}, | ||
Action: func(c *cli.Context) error { | ||
ctx := c.Context | ||
klog.Infof("config: %v", render.Render(flags)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is how this may look like:
I0930 12:07:36.979644 1 main.go:166] config: (*main.Flags){kubeClientConfig:flags.KubeClientConfig{KubeConfig:"", KubeAPIQPS:5, KubeAPIBurst:10}, loggingConfig:(*flags.LoggingConfig){config:(*v1.LoggingConfiguration){Format:"text", FlushFrequency:v1.TimeOrMetaDuration{Duration:v1.Duration{Duration:time.Duration(5000000000)}, SerializeAsString:true}, Verbosity:v1.VerbosityLevel(1), VModule:v1.VModuleConfiguration(nil), Options:v1.FormatOptions{Text:v1.TextOptions{OutputRoutingOptions:v1.OutputRoutingOptions{SplitStream:false, InfoBufferSize:resource.QuantityValue{Quantity:resource.Quantity{i:resource.int64Amount{value:0, scale:resource.Scale(0)}, d:resource.infDecAmount{Dec:(*inf.Dec)(nil)}, s:"0", Format:resource.Format("DecimalSI")}}}}, JSON:v1.JSONOptions{OutputRoutingOptions:v1.OutputRoutingOptions{SplitStream:false, InfoBufferSize:resource.QuantityValue{Quantity:resource.Quantity{i:resource.int64Amount{value:0, scale:resource.Scale(0)}, d:resource.infDecAmount{Dec:(*inf.Dec)(nil)}, s:"0", Format:resource.Format("DecimalSI")}}}}}}}, featureGateConfig:(*flags.FeatureGateConfig){}, nodeName:"gb-nvl-043-compute06", namespace:"nvidia-dra-driver-gpu", cdiRoot:"/var/run/cdi", containerDriverRoot:"/driver-root", hostDriverRoot:"/run/nvidia/driver", nvidiaCDIHookPath:"", kubeletRegistrarDirectoryPath:"/var/lib/kubelet/plugins_registry", kubeletPluginsDirectoryPath:"/var/lib/kubelet/plugins", healthcheckPort:51515}
Looks thick, but after all it's a condensed version of details that matter, such as
Verbosity:v1.VerbosityLevel(1)
healthcheckPort:51515
featureGateConfig:(*flags.FeatureGateConfig){}
Even the KubeClientConfig
may be relevant at times.
I'm not married to this though, just tried to find a pragmatic way and I can see that go-render
alone is a discussion point.
Signed-off-by: Dr. Jan-Philip Gehrcke <[email protected]>
Resolves #609.
This PR has a set of related changes that we can also discuss in separate PRs if preferred:
For better debuggability: log full component config (
flags
object) upon component startup (withgo-render
to quickly get to a stringified version of a more or less complex, nested struct -- open do using a different strategy).For control: introduction of a component-global
logVerbosity
Helm chart parameter, including documentation laying out the starting point for a verbosity system (comments very welcome)For less noise in default config:
logVerbosity
level documentation).For robustness, explicit log flushing as part of component shutdown (I think we missed this so far).
One interesting change that I propose here is to not have those "updated/added object callback" confirmations logged on the default log level in the CD controller -- I think we should try to not scale log volume with number of objects created (at least in default config).