Alerting: Add rule_query_offset setting for Prometheus rule conversion (#102500)
Adds a new configuration option to specify a time offset for rule evaluation, which gets applied and saved during the Prometheus -> Grafana conversion. For example: [unified_alerting.prometheus_conversion] rule_query_offset = 1m Changing this option affects only the rules imported after the change. If query_offset is set at the group level, it takes precedence over this setting. Default is set to 1m.
This commit is contained in:
@@ -463,6 +463,7 @@ func (srv *ConvertPrometheusSrv) convertToGrafanaRuleGroup(
|
||||
IsPaused: pauseAlertRules,
|
||||
},
|
||||
KeepOriginalRuleDefinition: util.Pointer(keepOriginalRuleDefinition),
|
||||
EvaluationOffset: &srv.cfg.PrometheusConversion.RuleQueryOffset,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user