@@ -81,8 +81,6 @@ const (
81
81
unknownHealthFilter string = "unknown"
82
82
okHealthFilter string = "ok"
83
83
errHealthFilter string = "err"
84
-
85
- livenessCheckTimeout = 100 * time .Millisecond
86
84
)
87
85
88
86
type DisabledRuleGroupErr struct {
@@ -161,7 +159,8 @@ type Config struct {
161
159
EnableQueryStats bool `yaml:"query_stats_enabled"`
162
160
DisableRuleGroupLabel bool `yaml:"disable_rule_group_label"`
163
161
164
- EnableHAEvaluation bool `yaml:"enable_ha_evaluation"`
162
+ EnableHAEvaluation bool `yaml:"enable_ha_evaluation"`
163
+ LivenessCheckTimeout time.Duration `yaml:"liveness_check_timeout"`
165
164
}
166
165
167
166
// Validate config and returns error on failure
@@ -238,6 +237,7 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
238
237
f .BoolVar (& cfg .DisableRuleGroupLabel , "ruler.disable-rule-group-label" , false , "Disable the rule_group label on exported metrics" )
239
238
240
239
f .BoolVar (& cfg .EnableHAEvaluation , "ruler.enable-ha-evaluation" , false , "Enable high availability" )
240
+ f .DurationVar (& cfg .LivenessCheckTimeout , "ruler.liveness-check-timeout" , 1 * time .Second , "Liveness check timeout" )
241
241
242
242
cfg .RingCheckPeriod = 5 * time .Second
243
243
}
@@ -590,7 +590,7 @@ func (r *Ruler) nonPrimaryInstanceOwnsRuleGroup(g *rulespb.RuleGroupDesc, replic
590
590
responseChan := make (chan * LivenessCheckResponse , len (jobs ))
591
591
592
592
ctx := user .InjectOrgID (context .Background (), userID )
593
- ctx , cancel := context .WithTimeout (ctx , livenessCheckTimeout )
593
+ ctx , cancel := context .WithTimeout (ctx , r . cfg . LivenessCheckTimeout )
594
594
defer cancel ()
595
595
596
596
err := concurrency .ForEach (ctx , jobs , len (jobs ), func (ctx context.Context , job interface {}) error {
0 commit comments