Skip to content
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(inputs): Add framework to retry on startup errors #15145

Merged
merged 6 commits into from
Apr 17, 2024

Conversation

srebhan
Copy link
Member

@srebhan srebhan commented Apr 11, 2024

Summary

A frequently requested feature is to retry startup for plugins in case of error e.g. if the connection to a remote machine fails.

Instead of implementing the logic for retrying in each plugin, this PR provides a framework for input-plugins to use if they wish to support retries. As an example, the AMQP input plugin is converted to use the new framework

More details can be found in the TSD-006 specification.

Checklist

  • No AI generated code was used in this PR

Related issues

resolves #14803
resolves #13746

@telegraf-tiger telegraf-tiger bot added the feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin label Apr 11, 2024
@srebhan srebhan added area/rabbitmq plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins area/agent labels Apr 11, 2024
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Apr 12, 2024
Copy link
Contributor

@powersj powersj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Played with this a bit this morning. I like it and it works as advertised. Two items:

  • Updated a log message below
  • It does seem you can add the startup_error_behavior to any plugin now whether it supports the call or not. Is there any way we can warn the user?

agent/agent.go Outdated Show resolved Hide resolved
Co-authored-by: Joshua Powers <powersj@fastmail.com>
@telegraf-tiger
Copy link
Contributor

@srebhan
Copy link
Member Author

srebhan commented Apr 15, 2024

@powersj unfortunately we cannot do anything to warn the user as we would need a way to find out if the plugin could return a retryable error at any point during startup... The alternative would be to mark the plugins somehow but this would have to be done manually.

@powersj powersj removed their assignment Apr 15, 2024
@DStrand1 DStrand1 merged commit 8d603cd into influxdata:master Apr 17, 2024
26 checks passed
@github-actions github-actions bot added this to the v1.31.0 milestone Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/agent area/rabbitmq feat Improvement on an existing feature such as adding a new setting/mode to an existing plugin plugin/input 1. Request for new input plugins 2. Issues/PRs that are related to input plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generic handling to ignore errors on startup Amqp consumer connection fail
3 participants