-
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
libbeat/monitoring/inputmon: log key, id and input type when registering/deregistering metrics #35647
Conversation
…ing/deregistering metrics This notes under "metric_registry" all inputmon-handled metric registration and deregistration, linking register and deregister operations by use of a unique ID unrelated to the request.
Pinging @elastic/security-external-integrations (Team:Security-External Integrations) |
I assume this is related to the panics that this causes. One suggestion is to modify
|
I'm not convinced that relaxing the constraint of registration is a good idea. |
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.
My main driver for making the change upstream is to lower the consequence of these programming mistakes on production systems. I like that the panic alerts us to these issues, but in production I would choose to have the input continue to operate and log and error about metric collection issues. Something along the lines of https://pkg.go.dev/go.uber.org/zap#Logger.DPanic behavior.
But the logging is useful in any case for debugging these problems.
Pinging @elastic/elastic-agent (Team:Elastic-Agent) |
…ing/deregistering metrics (#35647) This notes under "metric_registry" all inputmon-handled metric registration and deregistration, linking register and deregister operations by use of a unique ID unrelated to the request. (cherry picked from commit 8abdf32) # Conflicts: # libbeat/monitoring/inputmon/input.go
…nput type when registering/deregistering metrics (#35673) * libbeat/monitoring/inputmon: log key, id and input type when registering/deregistering metrics (#35647) This notes under "metric_registry" all inputmon-handled metric registration and deregistration, linking register and deregister operations by use of a unique ID unrelated to the request. (cherry picked from commit 8abdf32) # Conflicts: # libbeat/monitoring/inputmon/input.go * resolve conflicts --------- Co-authored-by: Dan Kortschak <90160302+efd6@users.noreply.github.com> Co-authored-by: Dan Kortschak <dan.kortschak@elastic.co>
What does this PR do?
This notes under "metric_registry" all inputmon-handled metric registration and deregistration, linking register and deregister operations by use of a unique ID unrelated to the request.
Why is it important?
We have had a number of cases where metric registrations have been duplicated, this addition allows us to identify pairs of registration/deregistration and correlate with prior un-deregistered registrations with the same name. The logging at INFO level speeds recovery of the information with minimal additional log load.
Checklist
CHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
How to test this PR locally
Related issues
Use cases
Screenshots
Logs