-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(agent): add ignore_error_inputs option for inputs #11304
Conversation
* add ignore_init_fail_input option for ignore initialization failed Input influxdata#11289 influxdata#10694 * rename option ignore_init_fail_input to ignore_error_inputs
* docs: add ignore_error_inputs docs * test: TestAgent_IgnoreErrorInputs * Update etc/telegraf.conf Co-authored-by: Kun Zhao <zhao-kun@users.noreply.github.com> * Update etc/telegraf_windows.conf Co-authored-by: Kun Zhao <zhao-kun@users.noreply.github.com> * Update docs/CONFIGURATION.md Co-authored-by: Kun Zhao <zhao-kun@users.noreply.github.com> * Update config/config.go Co-authored-by: Kun Zhao <zhao-kun@users.noreply.github.com> * Update docs/CONFIGURATION.md Co-authored-by: Kun Zhao <zhao-kun@users.noreply.github.com> * modify config/config.go ignore_error_inputs Default * Update agent/agent_test.go Co-authored-by: Hao Chen <chenhaox@gmail.com> * Update agent/agent_test.go Co-authored-by: Hao Chen <chenhaox@gmail.com> * Update agent/agent_test.go Co-authored-by: Hao Chen <chenhaox@gmail.com> * modify agent/agent_test.go * Remove the empty line for config.go * modify agent/agent_test.go * docs: modify telegraf.conf and telegraf_windows.conf Co-authored-by: Kun Zhao <zhao-kun@users.noreply.github.com> Co-authored-by: Hao Chen <chenhaox@gmail.com>
Thanks so much for the pull request! |
Thanks so much for the pull request! |
!signed-cla |
!signed-cla |
Good idea, but I would like to have this also be configurable per plugin. For example I accept errors for mqtt_consumer plugin, but not for cpu and disk plugin. Other agent config options like interval also have this, so should be doable. |
On the other hand, see #10086 where they fix the input in question to let it retry at each interval, that could be done for the plugins in question as well. |
Your ideas belong to individual plugin-level switches, which require more granular control. |
Good idea, but I don't just want to fix mongodb's init method. |
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.
Actually, we don't want to allow ignoring Init()
errors. However, we could accept this PR if this check is done against the Start()
return value.
Init is for checking actual configuration errors, Start is for actually connecting to endpoints.
Al the same checks could actually also be done for outputs and processors, so only addressing inputs is doing half of the job.
* feat(option): add ignore_init_error option for input * Update agent/agent.go * Update docs/CONFIGURATION.md Co-authored-by: Hao Chen <chenhaox@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.
Simplify the documentation a bit.
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
I will close this PR and the new PR address is: #11313 |
Required for all PRs:
resolves #11289, resolves #10694, resolves #3167
Summary
Add two options: agent.ignore_error_inputs and plugin.IgnoreInitError
If (plugin.ignore_init_error || ignore_error_inputs) is true, discard the input plugins that produce the error during initialization. Otherwise, the program will exit when an input plugin has an error occurred during the initialization.