Alerting: Add ability to control scheduler tick interval via config (#71980)
* add ability to control scheduler interval via config * add feature flag `configurableSchedulerTick`
This commit is contained in:
@@ -681,5 +681,14 @@ var (
|
||||
Stage: FeatureStageExperimental,
|
||||
Owner: grafanaObservabilityMetricsSquad,
|
||||
},
|
||||
{
|
||||
Name: "configurableSchedulerTick",
|
||||
Description: "Enable changing the scheduler base interval via configuration option unified_alerting.scheduler_tick_interval",
|
||||
Stage: FeatureStageExperimental,
|
||||
FrontendOnly: false,
|
||||
Owner: grafanaAlertingSquad,
|
||||
RequiresRestart: true,
|
||||
HideFromDocs: true,
|
||||
},
|
||||
}
|
||||
)
|
||||
|
||||
@@ -98,3 +98,4 @@ awsAsyncQueryCaching,experimental,@grafana/aws-datasources,false,false,false,fal
|
||||
splitScopes,preview,@grafana/grafana-authnz-team,false,false,true,false
|
||||
azureMonitorDataplane,GA,@grafana/partner-datasources,false,false,false,false
|
||||
prometheusConfigOverhaulAuth,experimental,@grafana/observability-metrics,false,false,false,false
|
||||
configurableSchedulerTick,experimental,@grafana/alerting-squad,false,false,true,false
|
||||
|
||||
|
@@ -402,4 +402,8 @@ const (
|
||||
// FlagPrometheusConfigOverhaulAuth
|
||||
// Update the Prometheus configuration page with the new auth component
|
||||
FlagPrometheusConfigOverhaulAuth = "prometheusConfigOverhaulAuth"
|
||||
|
||||
// FlagConfigurableSchedulerTick
|
||||
// Enable changing the scheduler base interval via configuration option unified_alerting.scheduler_tick_interval
|
||||
FlagConfigurableSchedulerTick = "configurableSchedulerTick"
|
||||
)
|
||||
|
||||
@@ -130,6 +130,7 @@ func NewScheduler(cfg SchedulerCfg, stateManager *state.Manager) *schedule {
|
||||
}
|
||||
|
||||
func (sch *schedule) Run(ctx context.Context) error {
|
||||
sch.log.Info("Starting scheduler", "tickInterval", sch.baseInterval)
|
||||
t := ticker.New(sch.clock, sch.baseInterval, sch.metrics.Ticker)
|
||||
defer t.Stop()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user