Alerting: Add MissingSeriesEvalsToResolve to the APIs (#102150)
What is this feature? A follow-up for #101184, adds AlertRule.MissingSeriesEvalsToResolve to the APIs. missing_series_evals_to_resolve must be specified too and it must be > 0. POST /api/ruler/grafana/api/v1/rules/{folderUID} works in the following way: If missing_series_evals_to_resolve is not sent or null, the rule keeps its existing value If missing_series_evals_to_resolve > 0: updates to that value If missing_series_evals_to_resolve = 0: resets to default (nil). AlertRule.MissingSeriesEvalsToResolve can't be 0, so I used it to reset In the Provisioning API, the value is just set if present and > 0. Otherwise it's reset: PUT to /api/v1/provisioning/alert-rules/{UID}: If missing_series_evals_to_resolve is nil, it's reset to the default value If missing_series_evals_to_resolve > 0, it's updated
This commit is contained in:
@@ -4442,6 +4442,10 @@
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"missing_series_evals_to_resolve": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"noDataState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -5855,6 +5859,10 @@
|
||||
"metadata": {
|
||||
"$ref": "#/definitions/AlertRuleMetadata"
|
||||
},
|
||||
"missing_series_evals_to_resolve": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"namespace_uid": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -7090,6 +7098,12 @@
|
||||
"metadata": {
|
||||
"$ref": "#/definitions/AlertRuleMetadata"
|
||||
},
|
||||
"missing_series_evals_to_resolve": {
|
||||
"description": "Number of consecutive evaluation intervals with no data for a dimension must pass\nbefore the alert state is considered stale and automatically resolved.\nIf set to 0, the value is reset to the default.",
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"example": 3
|
||||
},
|
||||
"no_data_state": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -7387,6 +7401,11 @@
|
||||
"team": "sre-team-1"
|
||||
}
|
||||
},
|
||||
"missingSeriesEvalsToResolve": {
|
||||
"type": "integer",
|
||||
"format": "int64",
|
||||
"example": 2
|
||||
},
|
||||
"noDataState": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
@@ -9039,7 +9058,6 @@
|
||||
}
|
||||
},
|
||||
"alertGroups": {
|
||||
"description": "AlertGroups alert groups",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
@@ -9201,7 +9219,6 @@
|
||||
}
|
||||
},
|
||||
"gettableAlerts": {
|
||||
"description": "GettableAlerts gettable alerts",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
|
||||
Reference in New Issue
Block a user