-
Notifications
You must be signed in to change notification settings - Fork 640
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
Make log pattern check configurable in health checker #536
Make log pattern check configurable in health checker #536
Conversation
Hi @abansal4032. 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. |
/cc Random-Liu |
cmd/healthchecker/options/options.go
Outdated
CriSocketPath string | ||
CoolDownTime time.Duration | ||
HealthCheckTimeout time.Duration | ||
LogPattern string |
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.
We should support multiple log patterns. Can we have a customized flag supporting this, e.g. https://play.golang.org/p/Ig5sm7jA14?
It could be something like this:
health-checker --log-pattern 10:aaaaaa --log-pattern 20:bbbbbb --log-pattern 15:ccccc
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 see. Yeah that can be helpful.
Is the idea in the above example --log-pattern threshold_count:pattern?
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.
Yeah. If we do pattern:threshold_count, it is possible that the pattern may contain :
, and make the parsing harder.
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.
Make sense. Changed.
/ok-to-test |
c0da157
to
c8631bc
Compare
|
||
// LogPatternFlag defines the flag for log pattern health check. | ||
// It contains a map of <log pattern> to <failure threshold for the pattern> | ||
type LogPatternFlag struct { |
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.
Add a unit test for this.
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.
Added unit tests.
LGTM, but please add a unit test. |
c8631bc
to
acd2444
Compare
acd2444
to
100f2bf
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abansal4032, Random-Liu 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 |
/test pull-npd-e2e-test |
This CL makes the log pattern and the threshold configurable through health checker plugin config through flags --log-pattern and --log-pattern-count-threshold respectively. An empty --log-pattern(default) will skip the log pattern check and not mark the service as unhealthy.