Alerting: Store instance annotations in alert rule state (#114975)

Alerting: Store annotations in alert instance state
This commit is contained in:
Alexander Akhmetov
2025-12-09 13:52:42 +01:00
committed by GitHub
parent 6746c978b4
commit c59d5d1c8e
17 changed files with 258 additions and 109 deletions
@@ -188,6 +188,7 @@ func alertInstanceModelToProto(modelInstance models.AlertInstance) *pb.AlertInst
return &pb.AlertInstance{
Labels: modelInstance.Labels,
LabelsHash: modelInstance.LabelsHash,
Annotations: modelInstance.Annotations,
CurrentState: string(modelInstance.CurrentState),
CurrentStateSince: timestamppb.New(modelInstance.CurrentStateSince),
CurrentStateEnd: timestamppb.New(modelInstance.CurrentStateEnd),
@@ -255,6 +256,7 @@ func alertInstanceProtoToModel(ruleUID string, ruleOrgID int64, protoInstance *p
LabelsHash: protoInstance.LabelsHash,
},
Labels: protoInstance.Labels,
Annotations: protoInstance.Annotations,
CurrentState: models.InstanceStateType(protoInstance.CurrentState),
CurrentStateSince: protoInstance.CurrentStateSince.AsTime(),
CurrentStateEnd: protoInstance.CurrentStateEnd.AsTime(),