-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add duration to certificate creation logs #2040
Add duration to certificate creation logs #2040
Conversation
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.
Technically, these times will be mangled by the cache / buffer underneath. Shouldn't we rather trace the actual key generation which is what takes the time?
pkg/kubecrypto/certs.go
Outdated
klog.V(2).InfoS("Creating certificate", "Secret", naming.ObjRef(tlsSecret.GetSecret()), "Reason", refreshReason) | ||
cert, key, err := certCreator.MakeCertificate(ctx, keyGetter, signer, validity) | ||
if err != nil { | ||
return nil, fmt.Errorf("can't create certificate: %w", err) | ||
} | ||
klog.V(2).InfoS("Certificate created", "Secret", naming.ObjRef(tlsSecret.GetSecret())) | ||
klog.V(2).InfoS("Certificate created", "Secret", naming.ObjRef(tlsSecret.GetSecret()), "Duration", time.Now().Sub(startTime)) |
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.
duration
is a bit ambiguous here (with cert lifetime)
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.
right, changed to ElapsedTime
but these are also misplaced with regards to the sync loop, so this may just be good enough |
New flake #2042 |
11d6b50
to
82bee22
Compare
right, key generation already has the duration and you can look there, but my reasoning was that if you start debugging from the reconciliation loop this is easier to notice |
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rzetelskik, tnozicka The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description of your changes: This PR adds duration to certificate creation logs for ease of debugging in scenarios similar to #1997. At the moment the pre and post-creation logs have to be matched to asses the time it took to create the certificate, which can be a long running action.
Which issue is resolved by this Pull Request:
Resolves #
/kind feature
/priority important-longterm