-
Notifications
You must be signed in to change notification settings - Fork 127
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
logging: better timestamp precision / log when CNI request finishes processing #381
base: master
Are you sure you want to change the base?
logging: better timestamp precision / log when CNI request finishes processing #381
Conversation
The old format - RFC3339 - does not have enough precision - we need to see milliseconds (at least) to understand how long does it take for a CNI ADD / DEL to be processed in the IPAM stage to understand how long does it take for a CNI ADD / DEL to be processed in the IPAM stage. Signed-off-by: Miguel Duarte Barroso <[email protected]>
We were missing a clear log indicating the IPAM CNI process is finishing. Now, it should be possible to understand how long a request takes from the logs. Signed-off-by: Miguel Duarte Barroso <[email protected]>
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.
Nice thanks
Can we add a space before the time ? (maybe need to remove T as well)
2023-08-17T12:57:03.831205669Z
-> 2023-08-17 12:57:03.831205669Z
defer func() { safeCloseKubernetesBackendConnection(ipam) }() | ||
defer func() { | ||
safeCloseKubernetesBackendConnection(ipam) | ||
logging.Debugf("DEL - IPAM plugin finished. Took: %q Config: %+v", time.Since(startTime).String(), *ipamConf) |
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.
maybe in case of a failure better to change to finished (failed)
so we can filter the failure lines easily when benchmarking ?
unless it is not important because when benchmarking we dont run failures cases
but it is more accurate this way, because it is not finished, but finished with failure
if it is - then also on ADD please
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.
Yes, there's no point bench marking failed results.
BUT it makes sense to log the result (or a simplified version of it).
I'll act on this.
defer func() { | ||
safeCloseKubernetesBackendConnection(ipam) | ||
logging.Debugf("ADD - IPAM plugin finished. Took: %q Config: %+v", time.Since(startTime).String(), *ipamConf) | ||
}() |
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.
Please consider using a function that gets a string, startTime and is reused in both places
as beside ADD / DEL string it is the same
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.
I'm OK with this PR as it stands. Oshoval's comments are nice improvements for sure. Thanks Miguel.
What this PR does / why we need it:
The old format - RFC3339 - does not have enough precision - we need to see milliseconds (at least) to understand how long does it take for a CNI ADD / DEL to be processed in the IPAM stage to understand how long does it take for a CNI ADD / DEL to be processed in the IPAM stage.
A new log in added when the CNI request ( ADD or DELETE) finishes processing. It prints how long it took to process the request.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer (optional):
Old format:
New format: