Skip to content

Commit

Permalink
Merge pull request #1528 from grafana/feat/alert-rule-keep-last
Browse files Browse the repository at this point in the history
feat: add KeepLast as valid value for no data & exec err state
  • Loading branch information
weisdd authored May 13, 2024
2 parents 645664d + 89c743a commit fa89d70
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
4 changes: 2 additions & 2 deletions api/v1beta1/grafanaalertrulegroup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ type AlertRule struct {
// +kubebuilder:validation:Required
Data []*AlertQuery `json:"data"`

// +kubebuilder:validation:Enum=OK;Alerting;Error
// +kubebuilder:validation:Enum=OK;Alerting;Error;KeepLast
ExecErrState string `json:"execErrState"`

// +kubebuilder:validation:Type=string
Expand All @@ -77,7 +77,7 @@ type AlertRule struct {

Labels map[string]string `json:"labels,omitempty"`

// +kubebuilder:validation:Enum=Alerting;NoData;OK
// +kubebuilder:validation:Enum=Alerting;NoData;OK;KeepLast
NoDataState *string `json:"noDataState"`

// +kubebuilder:validation:MinLength=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
- OK
- Alerting
- Error
- KeepLast
type: string
for:
format: duration
Expand All @@ -122,6 +123,7 @@ spec:
- Alerting
- NoData
- OK
- KeepLast
type: string
title:
example: Always firing
Expand Down
2 changes: 2 additions & 0 deletions config/grafana.integreatly.org_grafanaalertrulegroups.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ spec:
- OK
- Alerting
- Error
- KeepLast
type: string
for:
format: duration
Expand All @@ -175,6 +176,7 @@ spec:
- Alerting
- NoData
- OK
- KeepLast
type: string
title:
example: Always firing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ spec:
- OK
- Alerting
- Error
- KeepLast
type: string
for:
format: duration
Expand All @@ -122,6 +123,7 @@ spec:
- Alerting
- NoData
- OK
- KeepLast
type: string
title:
example: Always firing
Expand Down
2 changes: 2 additions & 0 deletions deploy/kustomize/base/crds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ spec:
- OK
- Alerting
- Error
- KeepLast
type: string
for:
format: duration
Expand All @@ -121,6 +122,7 @@ spec:
- Alerting
- NoData
- OK
- KeepLast
type: string
title:
example: Always firing
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ AlertRule defines a specific rule to be evaluated. It is based on the upstream m
<td>
<br/>
<br/>
<i>Enum</i>: OK, Alerting, Error<br/>
<i>Enum</i>: OK, Alerting, Error, KeepLast<br/>
</td>
<td>true</td>
</tr><tr>
Expand All @@ -295,7 +295,7 @@ AlertRule defines a specific rule to be evaluated. It is based on the upstream m
<td>
<br/>
<br/>
<i>Enum</i>: Alerting, NoData, OK<br/>
<i>Enum</i>: Alerting, NoData, OK, KeepLast<br/>
</td>
<td>true</td>
</tr><tr>
Expand Down

0 comments on commit fa89d70

Please sign in to comment.