-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
Use Case
Related to:
- feat(inputs.chrony): Add probe_on_startup option #16001
- feat(inputs.nvidia-smi): Add
probe_on_startup
option #15916
This option should follow a similar pattern to startup_error_behavior
. An interface will be defined:
type Prober interface {
Probe() error
}
If an input plugin defines this interface and probe_on_startup
is set to true
, telegraf will call Probe()
after it calls Start()
. If Probe()
returns an error, telegraf will handle it according to startup_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#L131
After calling .Start()
, if Start()
returns no error, it will optionally call Probe()
as an additional check. If Start()
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.go