Skip to content

feat(realtime): fix timestamp lag and add run_indefinitely flag#38

Open
pjbertels wants to merge 2 commits intoelastic:mainfrom
pjbertels:feat/realtime_fixes
Open

feat(realtime): fix timestamp lag and add run_indefinitely flag#38
pjbertels wants to merge 2 commits intoelastic:mainfrom
pjbertels:feat/realtime_fixes

Conversation

@pjbertels
Copy link
Copy Markdown
Contributor

@pjbertels pjbertels commented Mar 21, 2026

  • Remove Truncate(time.Second) from nowish so real-time timestamps are not systematically up to 1s behind wall clock
  • Add run_indefinitely flag to explicitly control whether the receiver runs forever, decoupling duration from pacing (real_time). Replaces the implicit behaviour where real_time: true with no end_time/end_now_minus would run indefinitely. Breaking change: configs relying on that implicit behaviour must add run_indefinitely: true.
  • Add validation error when start_now_minus is used with real_time: true — this combination results in a permanent timestamp lag with no way to recover.
  • Use currentTime.Before(EndTime) in the loop condition to avoid int64 overflow when EndTime is set to a far-future value
  • Update README with new flag documentation and a real-time indefinite example config
  • Update tests to use explicit run_indefinitely: true

- Remove Truncate(time.Second) from nowish so realtime timestamps are
  not systematically up to 1s behind wall clock
- Default EndTime to MaxInt64/time.Second when real_time is true and no
  end_time/end_now_minus is configured, so the receiver runs indefinitely
  instead of exiting immediately
- Use currentTime.Before(EndTime) in loop condition to avoid int64
  overflow when EndTime is set to a far-future value
- Add tests for indefinite realtime operation and wall clock timestamp
  alignment

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…acing

Introduces an explicit `run_indefinitely` flag that replaces the implicit
behaviour where `real_time: true` with no end time would run forever.
Also adds a validation error when `start_now_minus` is used with
`real_time: true`, as this results in a permanent timestamp lag.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@pjbertels pjbertels changed the title feat(realtime): fix timestamp lag and default to running indefinitely feat(realtime): fix timestamp lag and add run_indefinitely flag Mar 23, 2026
@pjbertels pjbertels requested a review from felixbarny March 23, 2026 18:18
Copy link
Copy Markdown
Member

@felixbarny felixbarny left a comment

Choose a reason for hiding this comment

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

One comment that should be addressed, otherwise LGTM!

@pjbertels pjbertels self-assigned this Mar 27, 2026
@pjbertels pjbertels added the enhancement New feature or request label Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants