Alerting: Add recording rules to ruler API and validation (#87779)
* Read path, main API * Define record field for incoming requests * Refactor several alerting specific validators into two paths * Refactor validateCondition actually contain all the condition validation logic * Move condition validation inside rule path * Validators for recording rules * Wire feature flag through to validators * Test for accepting a valid recording rule * Tests for negative case, no UID * Test for ignoring alerting fields * Build conditions based on recording rules as well * Regenerate swagger docs * Fix CRUD test to cover the right thing * Re-generate swagger docs with backdated v0.30.2 version * Regenerate base spec * Regenerate ngalert specs * Regenerate top level specs * Comment and rename * Return struct instead of modifying ref
This commit is contained in:
@@ -1573,6 +1573,9 @@
|
||||
"provenance": {
|
||||
"$ref": "#/definitions/Provenance"
|
||||
},
|
||||
"record": {
|
||||
"$ref": "#/definitions/Record"
|
||||
},
|
||||
"rule_group": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -2730,6 +2733,9 @@
|
||||
"notification_settings": {
|
||||
"$ref": "#/definitions/AlertRuleNotificationSettings"
|
||||
},
|
||||
"record": {
|
||||
"$ref": "#/definitions/Record"
|
||||
},
|
||||
"title": {
|
||||
"type": "string"
|
||||
},
|
||||
@@ -3247,6 +3253,18 @@
|
||||
"title": "ReceiverExport is the provisioned file export of alerting.ReceiverV1.",
|
||||
"type": "object"
|
||||
},
|
||||
"Record": {
|
||||
"properties": {
|
||||
"from": {
|
||||
"type": "string"
|
||||
},
|
||||
"metric": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "Record defines how data produced by a recording rule is written.",
|
||||
"type": "object"
|
||||
},
|
||||
"RelativeTimeRange": {
|
||||
"description": "RelativeTimeRange is the per query start and end time\nfor requests.",
|
||||
"properties": {
|
||||
@@ -4418,6 +4436,7 @@
|
||||
"type": "object"
|
||||
},
|
||||
"alertGroup": {
|
||||
"description": "AlertGroup alert group",
|
||||
"properties": {
|
||||
"alerts": {
|
||||
"description": "alerts",
|
||||
@@ -4441,7 +4460,6 @@
|
||||
"type": "object"
|
||||
},
|
||||
"alertGroups": {
|
||||
"description": "AlertGroups alert groups",
|
||||
"items": {
|
||||
"$ref": "#/definitions/alertGroup"
|
||||
},
|
||||
@@ -4602,12 +4620,14 @@
|
||||
"type": "object"
|
||||
},
|
||||
"gettableAlerts": {
|
||||
"description": "GettableAlerts gettable alerts",
|
||||
"items": {
|
||||
"$ref": "#/definitions/gettableAlert"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"gettableSilence": {
|
||||
"description": "GettableSilence gettable silence",
|
||||
"properties": {
|
||||
"comment": {
|
||||
"description": "comment",
|
||||
|
||||
Reference in New Issue
Block a user