Skip to content

probe_on_startup: Add input config and interface similar to startup_error_behavior #16028

@LandonTClipp

Description

@LandonTClipp

Use Case

Related to:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestRequests for new plugin and for new features to existing plugins

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions