-
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 #11313
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>
* 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.
For me same remark as in #11304 (review): This ignore errors check should happen against the result of Start()
instead of Init()
. We really want telegraf to halt when the plugin has wrong configuration or it could not be correctly initialised.
The major purpose is let the telegraf can be normally run even if some of the plugins have problem whatever it’s failed in Init or start. |
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 |
@Hipska |
@observeralone after discussing this matter with the team, we came to the conclusion that a global option to ignore all errors is not the way we want to go. There have been similar proposals (#10111) and requests (#3723, #9778) for the output side. However, we think it's better to fix the individual plugins to avoid connecting to services in For now, I'm closing this PR as a correct implementation requires a rework of Telegraf internals which is out-of-scope for now. |
While I can completely understand that the general ignoring of errors is not the way to go, I have to say that it would be a great hotfix until the error handling is actually implemented in the various plugins. In my case weve got a large production floor with many machines serving data via opcua, but not all of them are running all the time. |
Required for all PRs:
resolves #11289, resolves #10694, resolves #3167
revival of #11304
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.