Skip to content

Add telemetry job #1448

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

Merged
merged 11 commits into from
Jan 10, 2024
Prev Previous commit
Next Next commit
Updated jitter
  • Loading branch information
pleshakov committed Jan 10, 2024
commit d226662d3c10611d6bf4e8389bdd9e9bedd9c070
6 changes: 4 additions & 2 deletions internal/mode/static/telemetry/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,10 @@ func (j *Job) Start(ctx context.Context) error {
}

const (
jitterFactor = 0.1 // If the period is 10 seconds, the jitter will be up to 1 second.
sliding = true // This means the period with jitter will be calculated after each report() call.
// 10 min jitter is enough per telemetry destination recommendation
// For the default period of 24 hours, jitter will be 10min /(24*60)min = 0.0069
jitterFactor = 10.0 / (24 * 60) // added jitter is bound by jitterFactor * period
sliding = true // This means the period with jitter will be calculated after each report() call.
)

wait.JitterUntilWithContext(ctx, report, j.cfg.Period, jitterFactor, sliding)
Expand Down