-
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
probe_on_startup
: Add input config and interface similar to startup_error_behavior
#16028
Comments
probe_on_startup
): Add input config and interface similar to startup_error_behavior
probe_on_startup
: Add input config and interface similar to startup_error_behavior
Do we need an error to be returned or can this simply be a boolean? Furthermore, I would add the probe interface to the For what I want, you should distill your text above into spec with a PR to clearly define the behavior and the interaction with Alternatively, we could extend the startup spec... What do you think? |
Personally, having an error returned would be useful for logging purposes to identify what went wrong.
Absolutely 👍🏻
Sounds good, I can submit a PR and add a new spec. Regarding extending the startup-error-behavior spec, I think it will need to be updated to note that |
Regarding startup-error-behavior. What I was thinking is that we might want to add a Btw: Returning an error is OK, just don't expect any special handling, it's just a good on |
Ah, I see what you're saying. In that case, we would need to introduce multiple values:
To me, this feels... messy? Basically, we'd need a If you wanted, we could even go a step further and say |
I don't think you need the combinatorics. In my view . The settings If you think about it, what would |
I see your point, however I can imagine that some users would want to retain To say that a |
Maybe. And that's my point. Extending the startup behavior option makes it easy to extend the constraints later on. We have been bitten by combinatorics of parameters where we the had to evaluate all those weird combinations that do not make sense or cause ambiguities.
Yes but you also can't confidentially say other people want some other behavior. For me probing only makes sense in environments where I cannot be sure certain hardware or services are available. There might be use-cases for this but then I want a feature-request describing what the behavior should be and someone to actually test this in a real-world scenario instead of adding complexity upfront for cases nobody cares about. |
That's very fair. I'll have to defer to you on the direction to take since this is your project and not mine! I'm okay with the path of adding a single |
Use Case
Related to:
probe_on_startup
option #15916This option should follow a similar pattern to
startup_error_behavior
. An interface will be defined:If an input plugin defines this interface and
probe_on_startup
is set totrue
, telegraf will callProbe()
after it callsStart()
. IfProbe()
returns an error, telegraf will handle it according tostartup_error_behavior
.Please let me know your thoughts on this implementation, and if there are any other considerations to be made. I am happy to send in a PR if this looks good to you.
Expected behavior
This is not implemented.
Actual behavior
This is not implemented.
Additional info
The
RunningInput
type will be modified here: https://github.com/influxdata/telegraf/blob/v1.32.1/models/running_input.go#L131After calling
.Start()
, ifStart()
returns no error, it will optionally callProbe()
as an additional check. IfStart()
returns an error,Probe()
will never be called.The interface that defines
Probe()
will be written here: https://github.com/influxdata/telegraf/blob/v1.32.1/input.goThe text was updated successfully, but these errors were encountered: