From fb1b1204b44ce5b64d8be0e647c651ef0ca1d37e Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Thu, 18 Jun 2026 04:24:21 +0900 Subject: [PATCH] checker: raise default RTT warning threshold to 200ms The 100ms default warning collided with ordinary cross-region internet latency (e.g. transatlantic RTTs of ~100ms), causing spurious warnings on healthy long-haul targets. Bump the default warning to 200ms and factor the warning/critical defaults into package constants so the two call sites can no longer drift. --- checker/rules_rtt.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/checker/rules_rtt.go b/checker/rules_rtt.go index a6be757..5ef851e 100644 --- a/checker/rules_rtt.go +++ b/checker/rules_rtt.go @@ -28,6 +28,14 @@ import ( sdk "git.happydns.org/checker-sdk-go/checker" ) +// Default RTT thresholds in milliseconds. These sit above ordinary +// cross-region internet latency (e.g. transatlantic RTTs of ~100ms) so +// that healthy long-haul targets do not trigger spurious warnings. +const ( + defaultWarningRTT = 200.0 + defaultCriticalRTT = 500.0 +) + // rttRule evaluates the average round-trip time of each target against // the configured warning/critical thresholds. Unreachable targets (no // reply at all) are skipped; the reachability rule handles those. @@ -39,8 +47,8 @@ func (r *rttRule) Description() string { } func (r *rttRule) ValidateOptions(opts sdk.CheckerOptions) error { - warn := sdk.GetFloatOption(opts, "warningRTT", 100) - crit := sdk.GetFloatOption(opts, "criticalRTT", 500) + warn := sdk.GetFloatOption(opts, "warningRTT", defaultWarningRTT) + crit := sdk.GetFloatOption(opts, "criticalRTT", defaultCriticalRTT) if warn <= 0 { return fmt.Errorf("warningRTT must be positive") } @@ -59,8 +67,8 @@ func (r *rttRule) Evaluate(ctx context.Context, obs sdk.ObservationGetter, opts return []sdk.CheckState{noTargetsState("ping.rtt.no_targets")} } - warn := sdk.GetFloatOption(opts, "warningRTT", 100) - crit := sdk.GetFloatOption(opts, "criticalRTT", 500) + warn := sdk.GetFloatOption(opts, "warningRTT", defaultWarningRTT) + crit := sdk.GetFloatOption(opts, "criticalRTT", defaultCriticalRTT) out := make([]sdk.CheckState, 0, len(data.Targets)) for _, t := range data.Targets {