Skip to content
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

Merged

Conversation

sawsa307
Copy link
Contributor

@sawsa307 sawsa307 commented Feb 1, 2023

Added metrics to track the sync staleness of NEG syncers, where staleness is defined as how long since the syncer last syncs.

@sawsa307
Copy link
Contributor Author

sawsa307 commented Feb 1, 2023

/assign @swetharepakula

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 1, 2023
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 1, 2023
@k8s-ci-robot k8s-ci-robot requested review from aojea and freehan February 1, 2023 00:58
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 1, 2023
@sawsa307 sawsa307 force-pushed the neg-syncer-staleness-metrics branch from aef71bf to c60dea5 Compare February 1, 2023 05:53
@bowei
Copy link
Member

bowei commented Feb 9, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 9, 2023
Copy link
Member

@swetharepakula swetharepakula left a 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.

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),
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. Thanks!

@@ -149,6 +152,7 @@ func NewTransactionSyncer(
enableEndpointSlices: enableEndpointSlices,
inError: false,
logger: logger,
lastSyncTimestamp: time.Now(),
Copy link
Member

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?

Copy link
Contributor Author

@sawsa307 sawsa307 Feb 13, 2023

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.

Copy link
Member

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.

Copy link
Contributor Author

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.
@sawsa307 sawsa307 force-pushed the neg-syncer-staleness-metrics branch from c60dea5 to d0c5951 Compare February 13, 2023 22:57
Copy link
Member

@swetharepakula swetharepakula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 15, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 15, 2023
@k8s-ci-robot k8s-ci-robot merged commit 009e314 into kubernetes:master Feb 15, 2023
@sawsa307 sawsa307 deleted the neg-syncer-staleness-metrics branch September 2, 2023 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants