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

[Bug report]Collection interval is not respected when Telegraf process is reloaded #2839

Closed
haidaraM opened this issue May 22, 2017 · 4 comments

Comments

@haidaraM
Copy link

@haidaraM haidaraM commented May 22, 2017

Bug report

Relevant telegraf.conf:

[agent]
  interval = "10s"
  round_interval = true
  metric_batch_size = 1000
  metric_buffer_limit = 10000
  collection_jitter = "0s"
  flush_interval = "10m"
  flush_jitter = "0s"
  precision = ""

System info:

CentOS Linux release 7.1.1503 (Core)
Telegraf 1.2.1

Steps to reproduce:

  1. Configure a new input.exec plugin to run a command every 2m with a timeout of 1m.
[[inputs.exec]]
commands = ["/usr/local/bin/python3.5 /etc/telegraf/telegraf.d/my_script.py"]
interval = "2m"
timeout = "1m"
data_format = "influx"
  1. Reload Telegraf to take into account the new input: sudo service telegraf reload
  2. Wait a few moments to collect some metrics into InfluxDB for instance. Let's say for example the last metric was collected at 2017-05-19T07:00:40Z.
  3. Reload Telegraf : sudo service telegraf reload

Expected behavior:

The next metric should be collected at 2017-05-19T07:02:40Z

Actual behavior:

The next metric is collected before 2017-05-19T07:02:40Z and the next ones are collected 2m after and so on...

@danielnelson danielnelson added the bug label May 22, 2017
@haidaraM

This comment has been minimized.

Copy link
Author

@haidaraM haidaraM commented Jul 20, 2017

Any news about this bug ?

@danielnelson

This comment has been minimized.

Copy link
Contributor

@danielnelson danielnelson commented Jul 21, 2017

Only that I'm planning to fix it as part of the upcoming changes to configuration loading #272

@haidaraM

This comment has been minimized.

Copy link
Author

@haidaraM haidaraM commented Jul 21, 2017

Thanks for your reply

@danielnelson

This comment has been minimized.

Copy link
Contributor

@danielnelson danielnelson commented Nov 12, 2018

@haidaraM There are some changes in the upcoming 1.9.0 release that affect this, but it is not as described above in the expected behavior. If you were to restart at 07:00:40 the next collection for a interval = "2m" input would be at 07:02:00 because round_interval is true in the agent. The rounding is always done based on the effective interval of the plugin. Does this fulfill your requirements or should we consider more configurability of the rounding?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.