-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix unused libbeat.config.module metrics #19168
Fix unused libbeat.config.module metrics #19168
Conversation
These metrics existed in the code but were unused and hence always 0. "libbeat":{"config":{"module":{"running":0,"starts":0,"stops":0} I updated the module reload code to increment and set the metrics when changes are applied.
fdb336e
to
629b379
Compare
Pinging @elastic/integrations-services (Team:Services) |
❕ Build Aborted
Expand to view the summary
Build stats
Test stats 🧪
Log outputExpand to view the last 100 lines of log output
|
} | ||
|
||
moduleRunning.Set(int64(len(r.runners))) |
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.
Let's add a comment here that the metric is not necessarily correct. The Reload method calls go runner.Stop
and immediately removes the runner from the hashtable. But in fact (especially filebeat) the runner/input might still be active for an unknown amount of time (it's a common problem with reconfigured filebeat inputs erroring out on Start).
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.
Good point, I guess the original name wasn't necessary the best for this. I added some comments.
These metrics existed in the code but were unused and hence always 0. "libbeat":{"config":{"module":{"running":0,"starts":0,"stops":0} I updated the module reload code to increment and set the metrics when changes are applied. (cherry picked from commit 5d7e83b)
These metrics existed in the code but were unused and hence always 0. "libbeat":{"config":{"module":{"running":0,"starts":0,"stops":0} I updated the module reload code to increment and set the metrics when changes are applied. (cherry picked from commit 5d7e83b)
These metrics existed in the code but were unused and hence always 0. "libbeat":{"config":{"module":{"running":0,"starts":0,"stops":0} I updated the module reload code to increment and set the metrics when changes are applied.
What does this PR do?
These metrics existed in the code but were unused and hence always 0.
"libbeat":{"config":{"module":{"running":0,"starts":0,"stops":0}
I updated the module reload code to increment and set the metrics when changes are applied.
Why is it important?
If the metrics are exposed by
/stats
then they should work, otherwise they are misleading.Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Logs
I tested the metrics using Auditbeat module reloading: