Skip to content

Conversation

@redbaron
Copy link
Contributor

Summary

This changes behaviour of collection_jitter to be more like collection_offset, but with the offset calculated randomly for each plugin.

Net effect is that each plugin collection interval will be fixed at interval value, but collection times across all plugins will be spread over collection_jitter range.

Checklist

Related issues

resolves #17287

This changes behaviour of collection_jitter to be more like
collection_offset, but with the offset calculated randomly for each
plugin.

Net effect is that each plugin collection interval will be fixed at
`interval` value, but collection times across all plugins will be spread
over `collection_jitter` range.
@telegraf-tiger telegraf-tiger bot added the fix pr to fix corresponding bug label Dec 18, 2025
@telegraf-tiger
Copy link
Contributor

Copy link
Contributor

@skartikey skartikey left a comment

Choose a reason for hiding this comment

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

@redbaron Thanks for this PR! The change looks good and addresses the issue well. One thought:
The existing tests will still pass, but don't explicitly verify the new behaviour. It might be worth adding a test or two to capture the changed semantics - something that verifies the interval between ticks remains fixed even with jitter configured, or that the jitter offset stays consistent across multiple ticks. Just a suggestion - feel free to approach it however makes sense to you. The existing mock clock infrastructure in tick_test.go should make this straightforward.

@skartikey skartikey self-assigned this Jan 7, 2026
Co-authored-by: skartikey <[email protected]>
@skartikey
Copy link
Contributor

@redbaron Could you please rebase this PR onto the latest main branch? There is a failing test on the current base, and rebasing should pick up the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pr to fix corresponding bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[agent] collection_jitter increases effective collection interval

2 participants