-
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 | filebeat] Log error when parsing config block and disabled input on filebeat #30534
Conversation
This pull request does not have a backport label. Could you fix it @AndersonQ? 🙏
NOTE: |
Pinging @elastic/elastic-agent-control-plane (Team:Elastic-Agent-Control-Plane) |
This pull request doesn't have a |
This pull request is now in conflicts. Could you fix it? 🙏
|
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 a small suggestion around the wording of the log message for the harvester, other than that LGTM.
@@ -105,7 +105,7 @@ func (c *crawler) Start( | |||
}() | |||
} | |||
|
|||
log.Infof("Loading and starting Inputs completed. Enabled inputs: %v", len(c.inputs)) | |||
log.Infof("Loading and starting Inputs completed. Enabled inputs: %d", len(c.inputs)) | |||
|
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.
@AndersonQ The len() is a good start but let's be more precise like having a detailed count for each input. IE. Filestream input: 2
, same comment for this log statement.
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'm logging the input config keys now on startInput
now.
The inputs
field doesn't have much information to log, it's an implementation of Runner
:/
@@ -256,8 +257,8 @@ func (cm *Manager) apply(blocks ConfigBlocks) error { | |||
} | |||
|
|||
// Unset missing configs | |||
for name := range missing { | |||
if missing[name] { | |||
for name, isMissing := range missing { |
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.
+1 nice change.
Co-authored-by: Pier-Hugues Pellerin <phpellerin@gmail.com>
/test |
1 similar comment
/test |
/test |
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.
Changes LGTM.
This PRs improves logging for the management and filebeat input.
We should do something similar for to others beats too. But's let's get this merged.
// TODO: Either use debug or remove it after https://github.com/elastic/beats/pull/30534 | ||
// is fixed. | ||
c.log.Infof("starting input, keys present on the config: %v", | ||
config.FlattenedKeys()) |
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.
++ for not leaking senstitive information.
This pull request is now in conflicts. Could you fix it? 🙏
|
… input * log error when parsing config block and disabled input on filebeat (#30534) - log error when parsing config block and disabled input on filebeat - adjust tests and add an optional error message for 'wait_until' on libbeat python tests (cherry picked from commit b25fdf6) Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
… input * log error when parsing config block and disabled input on filebeat (#30534) - log error when parsing config block and disabled input on filebeat - adjust tests and add an optional error message for 'wait_until' on libbeat python tests (cherry picked from commit b25fdf6) Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
…d input * log error when parsing config block and disabled input on filebeat (#30534) - log error when parsing config block and disabled input on filebeat - adjust tests and add an optional error message for 'wait_until' on libbeat python tests (cherry picked from commit b25fdf6) Co-authored-by: Anderson Queiroz <anderson.queiroz@elastic.co>
…lastic#30534) - log error when parsing config block and disabled input on filebeat - adjust tests and add an optional error message for 'wait_until' on libbeat python tests (cherry picked from commit b25fdf6) # Conflicts: # filebeat/beater/crawler.go # libbeat/tests/system/beat/beat.py
What does this PR do?
Improve logging on filebeat to show better what happens when it's parsing the configs.
Why is it important?
Stop omitting errors and will help to investigate #30533
Checklist
[ ] I have commented my code, particularly in hard-to-understand areas[ ] I have made corresponding changes to the documentation[ ] I have made corresponding change to the default configuration files[ ] I have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Related issues