-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
prober: Remove spam of changing probe status #5051
prober: Remove spam of changing probe status #5051
Conversation
Signed-off-by: Juozas Vainauskas <vainauskasjuozas@gmail.com>
Signed-off-by: Juozas Vainauskas <vainauskasjuozas@gmail.com>
pkg/prober/intrumentation.go
Outdated
@@ -23,7 +24,8 @@ type InstrumentationProbe struct { | |||
component component.Component | |||
logger log.Logger | |||
|
|||
status *prometheus.GaugeVec | |||
status *prometheus.GaugeVec | |||
formerStatus 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 need a lock here since Ready/NotReady could be called from multiple goroutines. Also, it's not really former
, is it? It's the current status at the time of the function call thus it looks weird. I suggest being explicit here and renaming these two variables into statusMetric
and statusString
or something.
Signed-off-by: Juozas Vainauskas <vainauskasjuozas@gmail.com>
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.
Please run make go-format
to fix the linter issues 👍
pkg/prober/intrumentation.go
Outdated
p.mu.Lock() | ||
defer p.mu.Unlock() | ||
if p.statusString != ready { | ||
level.Info(p.logger).Log("msg", "changing probe status", "status", "ready") |
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.
level.Info(p.logger).Log("msg", "changing probe status", "status", "ready") | |
level.Info(p.logger).Log("msg", "changing probe status", "status", ready) |
Signed-off-by: Juozas Vainauskas <vainauskasjuozas@gmail.com>
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.
👍 thx
Issue: #5036
Changes
Remove constant spam of "changing probe status" if status of the probe was set to the same value as before
Verification
I ran
make quickstart
without my changes and saw that"changing probe status"
messages are spammed even though probe status was set to the same value as before. Then I added my changes, ranmake quickstart
again and got certain that these kind of logs do not repeat if probe status does not change to different value than before.