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

pkg/k8s: fix k8s_event_lag_seconds for negative time #14313

Merged
merged 1 commit into from Dec 9, 2020

Conversation

aanm
Copy link
Member

@aanm aanm commented Dec 8, 2020

In some occasions the metric k8s_event_lag_seconds could be presented
as an overflown value such as 9223372036854775807. This commit fixes
this by checking if the calculated value is less than zero by only
setting this metric for positive times.

Fixes: 4e29130 ("pkg/endpoint: calculate Kube API-Server lag from pod events")
Signed-off-by: André Martins andre@cilium.io

Fixes: #14309

Fix possible overflow in values presented in the `k8s_event_lag_seconds` metric.

In some occasions the metric `k8s_event_lag_seconds` could be presented
as an overflown value such as `9223372036854775807`. This commit fixes
this by checking if the calculated value is less than zero by only
setting this metric for positive times.

Fixes: 4e29130 ("pkg/endpoint: calculate Kube API-Server lag from pod events")
Signed-off-by: André Martins <andre@cilium.io>
@aanm aanm requested review from a team and fristonio December 8, 2020 21:28
@maintainer-s-little-helper maintainer-s-little-helper bot added dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Dec 8, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Dec 8, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.9.2 Dec 8, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.8.7 Dec 8, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added this to Needs backport from master in 1.7.13 Dec 8, 2020
@aanm aanm added release-note/bug This PR fixes an issue in a previous release of Cilium. and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Dec 8, 2020
@aanm
Copy link
Member Author

aanm commented Dec 8, 2020

test-me-please

Copy link
Member

@christarazi christarazi left a comment

Choose a reason for hiding this comment

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

Did we understand why it was negative to begin with? Shouldn't the time since always be going forward?

@aanm
Copy link
Member Author

aanm commented Dec 8, 2020

hit #14125

@aanm
Copy link
Member Author

aanm commented Dec 8, 2020

retest-runtime

Copy link
Member

@fristonio fristonio left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@aanm
Copy link
Member Author

aanm commented Dec 9, 2020

hit #14330

@aanm aanm merged commit 478f409 into cilium:master Dec 9, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Dec 9, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.9 in 1.9.2 Dec 15, 2020
@jibi jibi mentioned this pull request Dec 17, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.7 in 1.7.13 Dec 17, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.7 in 1.7.13 Dec 17, 2020
@jibi jibi mentioned this pull request Dec 17, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Needs backport from master to Backport pending to v1.8 in 1.8.7 Dec 17, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.9 to Backport done to v1.9 in 1.9.2 Dec 18, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.9 to Backport done to v1.9 in 1.9.2 Dec 18, 2020
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.8 to Backport done to v1.8 in 1.8.7 Jan 6, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot moved this from Backport pending to v1.7 to Backport done to v1.7 in 1.7.13 Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/bug This PR fixes an issue in a previous release of Cilium.
Projects
No open projects
1.7.13
Backport done to v1.7
1.8.7
Backport done to v1.8
1.9.2
Backport done to v1.9
Development

Successfully merging this pull request may close these issues.

Metrics: metric for k8s_event_lag_seconds implemented as a gauge is not actionable
6 participants