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:
Yuri Tseretyan
2023-07-26 12:44:12 -04:00
committed by GitHub
parent 8415dd40d7
commit c7598cc6fb
7 changed files with 70 additions and 0 deletions
+9
View File
@@ -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,
},
}
)
+1
View File
@@ -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
1 Name Stage Owner requiresDevMode RequiresLicense RequiresRestart FrontendOnly
98 splitScopes preview @grafana/grafana-authnz-team false false true false
99 azureMonitorDataplane GA @grafana/partner-datasources false false false false
100 prometheusConfigOverhaulAuth experimental @grafana/observability-metrics false false false false
101 configurableSchedulerTick experimental @grafana/alerting-squad false false true false
+4
View File
@@ -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()