@@ -37,7 +37,6 @@ import (
37
37
util_api "github.com/cortexproject/cortex/pkg/util/api"
38
38
"github.com/cortexproject/cortex/pkg/util/concurrency"
39
39
"github.com/cortexproject/cortex/pkg/util/flagext"
40
- "github.com/cortexproject/cortex/pkg/util/grpcclient"
41
40
util_log "github.com/cortexproject/cortex/pkg/util/log"
42
41
"github.com/cortexproject/cortex/pkg/util/services"
43
42
"github.com/cortexproject/cortex/pkg/util/validation"
@@ -100,7 +99,7 @@ type Config struct {
100
99
// Labels to add to all alerts
101
100
ExternalLabels labels.Labels `yaml:"external_labels,omitempty" doc:"nocli|description=Labels to add to all alerts."`
102
101
// GRPC Client configuration.
103
- ClientTLSConfig grpcclient. Config `yaml:"ruler_client"`
102
+ ClientTLSConfig ClientConfig `yaml:"ruler_client"`
104
103
// How frequently to evaluate rules by default.
105
104
EvaluationInterval time.Duration `yaml:"evaluation_interval"`
106
105
// How frequently to poll for updated rules.
@@ -154,8 +153,7 @@ type Config struct {
154
153
EnableQueryStats bool `yaml:"query_stats_enabled"`
155
154
DisableRuleGroupLabel bool `yaml:"disable_rule_group_label"`
156
155
157
- EnableHAEvaluation bool `yaml:"enable_ha_evaluation"`
158
- ListRulesFanoutTimeout time.Duration `yaml:"list_rules_fanout_timeout"`
156
+ EnableHAEvaluation bool `yaml:"enable_ha_evaluation"`
159
157
}
160
158
161
159
// Validate config and returns error on failure
@@ -180,7 +178,7 @@ func (cfg *Config) Validate(limits validation.Limits, log log.Logger) error {
180
178
181
179
// RegisterFlags adds the flags required to config this to the given FlagSet
182
180
func (cfg * Config ) RegisterFlags (f * flag.FlagSet ) {
183
- cfg .ClientTLSConfig .RegisterFlagsWithPrefix ("ruler.client" , "" , f )
181
+ cfg .ClientTLSConfig .RegisterFlagsWithPrefix ("ruler.client" , f )
184
182
cfg .Ring .RegisterFlags (f )
185
183
cfg .Notifier .RegisterFlags (f )
186
184
@@ -226,7 +224,6 @@ func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
226
224
f .BoolVar (& cfg .DisableRuleGroupLabel , "ruler.disable-rule-group-label" , false , "Disable the rule_group label on exported metrics" )
227
225
228
226
f .BoolVar (& cfg .EnableHAEvaluation , "ruler.enable-ha-evaluation" , false , "Enable high availability" )
229
- f .DurationVar (& cfg .ListRulesFanoutTimeout , "ruler.list-rules-fanout-timeout" , 2 * time .Minute , "Timeout for fanout calls to other rulers" )
230
227
231
228
cfg .RingCheckPeriod = 5 * time .Second
232
229
}
@@ -312,7 +309,7 @@ type Ruler struct {
312
309
313
310
// NewRuler creates a new ruler from a distributor and chunk store.
314
311
func NewRuler (cfg Config , manager MultiTenantManager , reg prometheus.Registerer , logger log.Logger , ruleStore rulestore.RuleStore , limits RulesLimits ) (* Ruler , error ) {
315
- return newRuler (cfg , manager , reg , logger , ruleStore , limits , newRulerClientPool (cfg .ClientTLSConfig , logger , reg ))
312
+ return newRuler (cfg , manager , reg , logger , ruleStore , limits , newRulerClientPool (cfg .ClientTLSConfig . Config , logger , reg ))
316
313
}
317
314
318
315
func newRuler (cfg Config , manager MultiTenantManager , reg prometheus.Registerer , logger log.Logger , ruleStore rulestore.RuleStore , limits RulesLimits , clientPool ClientsPool ) (* Ruler , error ) {
@@ -1300,7 +1297,7 @@ func (r *Ruler) getShardedRules(ctx context.Context, userID string, rulesRequest
1300
1297
return errors .Wrapf (err , "unable to get client for ruler %s" , addr )
1301
1298
}
1302
1299
1303
- ctx , cancel := context .WithTimeout (ctx , r .cfg .ListRulesFanoutTimeout )
1300
+ ctx , cancel := context .WithTimeout (ctx , r .cfg .ClientTLSConfig . RemoteTimeout )
1304
1301
defer cancel ()
1305
1302
newGrps , err := rulerClient .Rules (ctx , & RulesRequest {
1306
1303
RuleNames : rulesRequest .GetRuleNames (),
0 commit comments