Alerting: Implement setting of version message in convert API. (#114331)

Part 2 of adding version messages to the `alert_rule_version` able. This allows
setting the message via a header when using the Prometheus conversion API,
which can be useful for e.g. linking changes back to source control.
This commit is contained in:
Steve Simpson
2025-11-25 11:20:28 +01:00
committed by GitHub
parent b57e6383e4
commit d50e2a94a3
16 changed files with 212 additions and 101 deletions
+2 -2
View File
@@ -576,9 +576,9 @@ func (srv RulerSrv) performUpdateAlertRules(ctx context.Context, c *contextmodel
}
if len(finalChanges.New) > 0 {
inserts := make([]ngmodels.AlertRule, 0, len(finalChanges.New))
inserts := make([]ngmodels.InsertRule, 0, len(finalChanges.New))
for _, rule := range finalChanges.New {
inserts = append(inserts, *rule)
inserts = append(inserts, ngmodels.InsertRule{AlertRule: *rule})
}
added, err := srv.store.InsertAlertRules(tranCtx, ngmodels.NewUserUID(c.SignedInUser), inserts)
if err != nil {