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

Allow input plugin to be run on start #9245

Closed
lucassardois opened this issue May 6, 2021 · 3 comments
Closed

Allow input plugin to be run on start #9245

lucassardois opened this issue May 6, 2021 · 3 comments
Labels
feature request Requests for new plugin and for new features to existing plugins

Comments

@lucassardois
Copy link

Feature Request

Allow Telegraf inputs plugins to be run on start

Proposal:

Allow Telegraf inputs plugins to be run on start trough a new configuration attribute onstart which default to false, but when set to true would run the input plugin after Telegraf has started.

Current behavior:

Input plugins are run every interval or round_interval.

Desired behavior:

I want the input plugin to be run right after Telegraf start.

Use case:

I fetch an HTTP API every 3 hours thanks to the http plugin. This fetch then insert the resulting data in InfluxDB. I want to be able to run the first fetch right after Telegraf start so my database will directly have data and clients don't need to wait 3 hours before querying InfluxDB.

@lucassardois lucassardois added the feature request Requests for new plugin and for new features to existing plugins label May 6, 2021
@Hipska
Copy link
Contributor

Hipska commented Jun 25, 2021

Doesn't setting the round_interval to false already do that?

Otherwise, you could shedule this collection with a cron job every 3 hours with the --once parameter..

@sjwang90
Copy link
Contributor

@lucassardois - if you set round_interval = false as hipska mentioned your Telegraf will run and collect right away and continue collecting every 3 hours from there.

@Hipska
Copy link
Contributor

Hipska commented Feb 1, 2022

The #10545 might also interest you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins
Projects
None yet
Development

No branches or pull requests

3 participants