Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pkg/services/ngalert/state/compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ const (
ErrorAlertName = "DatasourceError"

Rulename = "rulename"

LogzioStateTransitionAnnotation = "__logzioStateTransition__" // LOGZ.IO GRAFANA CHANGE :: DEV-48550 - Add state transition to annotations
)

// StateToPostableAlert converts a state to a model that is accepted by Alertmanager. Annotations and Labels are copied from the state.
Expand Down Expand Up @@ -159,6 +161,7 @@ func FromStateTransitionToPostableAlerts(firingStates []StateTransition, stateMa
alert.Annotations[ngModels.LogzioAccountIdAnnotation] = logzAccountId
}
}
alert.Annotations[LogzioStateTransitionAnnotation] = fmt.Sprintf("{\"state\":\"%v\",\"previousState\":\"%v\"}", alertState.State.State, alertState.PreviousState) // LOGZ.IO GRAFANA CHANGE :: DEV-48550 - Add state transition to annotations
// LOGZ.IO GRAFANA CHANGE :: End
alerts.PostableAlerts = append(alerts.PostableAlerts, *alert)
if alertState.StateReason == ngModels.StateReasonMissingSeries { // do not put stale state back to state manager
Expand Down