-
Notifications
You must be signed in to change notification settings - Fork 303
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 metrics to track syncer staleness #1927
Add metrics to track syncer staleness #1927
Conversation
/assign @swetharepakula |
Hi @sawsa307. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
aef71bf
to
c60dea5
Compare
/ok-to-test |
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.
A couple nits, but otherwise this looks good to me.
pkg/neg/metrics/metrics.go
Outdated
Name: syncerStalenessKey, | ||
Help: "The duration that NEG syncers have been stale(out of sync)", | ||
// custom buckets - [1s, 2s, 4s, 8s, 16s, 32s, 64s, 128s, 256s(~4min), 512s(~8min), 1024s(~17min), 2048 (~34min), 4096(~68min), +Inf] | ||
Buckets: prometheus.ExponentialBuckets(1, 2, 13), |
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.
Increase to one more bucket. I don't think we should see anything that high, but I am thinking one more bucket after an hour would be good.
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.
Updated. Thanks!
pkg/neg/syncers/transaction.go
Outdated
@@ -149,6 +152,7 @@ func NewTransactionSyncer( | |||
enableEndpointSlices: enableEndpointSlices, | |||
inError: false, | |||
logger: logger, | |||
lastSyncTimestamp: time.Now(), |
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.
This is I think is available on the svcneg CR already. Can we reuse?
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.
Hi Swetha are you referring to this part?
https://github.com/kubernetes/ingress-gce/blob/master/pkg/neg/controller.go#L406-L409
These two are different since this one is tracking at controller level, and the above one is tracking at the neg/syncer level.
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.
Discussed offline, I was referring to https://github.com/kubernetes/ingress-gce/blob/master/pkg/apis/svcneg/v1beta1/types.go#L56. We set this every sync, so I think we can reuse that value.
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.
Updated. Thanks!
Added metrics to track the sync staleness of NEG syncers, where staleness is defined as how long since the syncer last syncs.
c60dea5
to
d0c5951
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sawsa307, swetharepakula 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 |
Added metrics to track the sync staleness of NEG syncers, where staleness is defined as how long since the syncer last syncs.