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

aggregate: Don't skip metrics which are in next aggretationperiod #3688

Closed
wants to merge 2 commits into from

Conversation

piotr1212
Copy link
Contributor

While running metrics from logparser through an aggregator I noticed some metrics were lost. Found out in some times the metrics timestamp was later than the current aggregation method. This PR queues metrics in the next aggregation method and processes them the next round. I'm not sure if this the correct way to fix this but it works for us.

Required for all PRs:

  • Signed CLA.
  • Associated README.md updated.
  • Has appropriate unit tests.

Aggregate would skip metrics which are not in the current aggregation method.
This caused a lot skipped metrics which originated from the logparser plugin.
Now if the metric is in the next aggregation interval don't skip it but queue it
and process it in the next aggregation interval.
@danielnelson
Copy link
Contributor

Do you know what caused the metrics to be too new? I wonder if perhaps we are not setting the periodEnd correctly.

@piotr1212
Copy link
Contributor Author

piotr1212 commented Jan 17, 2018 via email

@danielnelson
Copy link
Contributor

I don't want to add metric buffering to the aggregators, but I am interested in knowing why this was happening. Perhaps the log had future timestamps due to clock skew?

@piotr1212
Copy link
Contributor Author

Found the issue. This PR makes no sense.

now is set here https://github.com/influxdata/telegraf/blob/master/agent/agent.go#L123 by the time the code reaches the if statement in in RunningAggregator.Run() on my system 600ms passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants