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

aggregators: allow historical data in aggregators #6119

Closed
wants to merge 1 commit into from

Conversation

kevin-cantwell
Copy link

Addresses #1992

This PR adds a boolean config to aggregator plugins, allow_historical, which overrides the default behavior of ignoring metrics outside the period of the plugin. This override is useful when aggregating old logs or metrics that are delayed beyond the period window.

Required for all PRs:

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

@@ -1065,6 +1065,18 @@ func buildAggregator(name string, tbl *ast.Table) (*models.AggregatorConfig, err
}
}

if node, ok := tbl.Fields["allow_historical"]; ok {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am I correctly inferring that this is internal to telegraf? would this work for all plugins?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would work for all aggregator type plugins. Which means it extends all existing aggregator plugins with added functionality, but because the default value is false, it does not have adverse affects to existing deployments.

@danielnelson
Copy link
Contributor

I just merged #6049, it should be possible to use it to get this type of behavior just by setting the new grace period option very high.

@kevin-cantwell
Copy link
Author

Thanks @danielnelson your solution works for us 👍

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.

None yet

3 participants