Skip to content

Commit

Permalink
chore: update alerting swagger spec
Browse files Browse the repository at this point in the history
  • Loading branch information
GRodrigoSM authored Nov 4, 2024
1 parent feee8df commit d4350cf
Show file tree
Hide file tree
Showing 3 changed files with 359 additions and 78 deletions.
141 changes: 115 additions & 26 deletions pkg/services/ngalert/api/tooling/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@
],
"type": "string"
},
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettingsExport"
},
"panelId": {
"format": "int64",
"type": "integer"
Expand Down Expand Up @@ -294,6 +297,91 @@
},
"type": "object"
},
"AlertRuleNotificationSettings": {
"description": "swagger: model",
"properties": {
"group_by": {
"default": [
"alertname",
"grafana_folder"
],
"description": "Override the labels by which incoming alerts are grouped together. For example, multiple alerts coming in for\ncluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels\nuse the special value '...' as the sole label name.\nThis effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what\nyou want, unless you have a very low alert volume or your upstream notification system performs its own grouping.\nMust include 'alertname' and 'grafana_folder' if not using '...'.",
"example": [
"alertname",
"grafana_folder",
"cluster"
],
"items": {
"type": "string"
},
"type": "array"
},
"group_interval": {
"description": "Override how long to wait before sending a notification about new alerts that are added to a group of alerts for\nwhich an initial notification has already been sent. (Usually ~5m or more.)",
"example": "5m",
"type": "string"
},
"group_wait": {
"description": "Override how long to initially wait to send a notification for a group of alerts. Allows to wait for an\ninhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.)",
"example": "30s",
"type": "string"
},
"mute_time_intervals": {
"description": "Override the times when notifications should be muted. These must match the name of a mute time interval defined\nin the alertmanager configuration mute_time_intervals section. When muted it will not send any notifications, but\notherwise acts normally.",
"example": [
"maintenance"
],
"items": {
"type": "string"
},
"type": "array"
},
"receiver": {
"description": "Name of the receiver to send notifications to.",
"example": "grafana-default-email",
"type": "string"
},
"repeat_interval": {
"description": "Override how long to wait before sending a notification again if it has already been sent successfully for an\nalert. (Usually ~3h or more).\nNote that this parameter is implicitly bound by Alertmanager's `--data.retention` configuration flag.\nNotifications will be resent after either repeat_interval or the data retention period have passed, whichever\noccurs first. `repeat_interval` should not be less than `group_interval`.",
"example": "4h",
"type": "string"
}
},
"required": [
"receiver"
],
"type": "object"
},
"AlertRuleNotificationSettingsExport": {
"properties": {
"group_by": {
"items": {
"type": "string"
},
"type": "array"
},
"group_interval": {
"type": "string"
},
"group_wait": {
"type": "string"
},
"mute_time_intervals": {
"items": {
"type": "string"
},
"type": "array"
},
"receiver": {
"type": "string"
},
"repeat_interval": {
"type": "string"
}
},
"title": "AlertRuleNotificationSettingsExport is the provisioned export of models.NotificationSettings.",
"type": "object"
},
"AlertRuleUpgrade": {
"properties": {
"sendsTo": {
Expand Down Expand Up @@ -752,6 +840,9 @@
},
"webhook_url": {
"$ref": "#/definitions/SecretURL"
},
"webhook_url_file": {
"type": "string"
}
},
"title": "DiscordConfig configures notifications via Discord.",
Expand Down Expand Up @@ -1560,6 +1651,9 @@
],
"type": "string"
},
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"orgId": {
"format": "int64",
"type": "integer"
Expand Down Expand Up @@ -2028,6 +2122,9 @@
"send_resolved": {
"type": "boolean"
},
"summary": {
"type": "string"
},
"text": {
"type": "string"
},
Expand All @@ -2036,6 +2133,9 @@
},
"webhook_url": {
"$ref": "#/definitions/SecretURL"
},
"webhook_url_file": {
"type": "string"
}
},
"type": "object"
Expand Down Expand Up @@ -2531,24 +2631,6 @@
"PermissionDenied": {
"type": "object"
},
"Point": {
"description": "If H is not nil, then this is a histogram point and only (T, H) is valid.\nIf H is nil, then only (T, V) is valid.",
"properties": {
"H": {
"$ref": "#/definitions/FloatHistogram"
},
"T": {
"format": "int64",
"type": "integer"
},
"V": {
"format": "double",
"type": "number"
}
},
"title": "Point represents a single data point for a given timestamp.",
"type": "object"
},
"PostableApiAlertingConfig": {
"properties": {
"global": {
Expand Down Expand Up @@ -2803,6 +2885,9 @@
],
"type": "string"
},
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"title": {
"type": "string"
},
Expand Down Expand Up @@ -2979,6 +3064,9 @@
],
"type": "string"
},
"notification_settings": {
"$ref": "#/definitions/AlertRuleNotificationSettings"
},
"orgID": {
"format": "int64",
"type": "integer"
Expand Down Expand Up @@ -3659,7 +3747,12 @@
"type": "object"
},
"Sample": {
"description": "Sample is a single sample belonging to a metric. It represents either a float\nsample or a histogram sample. If H is nil, it is a float sample. Otherwise,\nit is a histogram sample.",
"properties": {
"F": {
"format": "double",
"type": "number"
},
"H": {
"$ref": "#/definitions/FloatHistogram"
},
Expand All @@ -3669,13 +3762,8 @@
"T": {
"format": "int64",
"type": "integer"
},
"V": {
"format": "double",
"type": "number"
}
},
"title": "Sample is a single sample belonging to a metric.",
"type": "object"
},
"Secret": {
Expand Down Expand Up @@ -4358,7 +4446,7 @@
"type": "array"
},
"Vector": {
"description": "Vector is basically only an alias for model.Samples, but the\ncontract is that in a Vector, all Samples have the same timestamp.",
"description": "Vector is basically only an alias for []Sample, but the contract is that\nin a Vector, all Samples have the same timestamp.",
"items": {
"$ref": "#/definitions/Sample"
},
Expand Down Expand Up @@ -4638,6 +4726,7 @@
"type": "object"
},
"gettableAlert": {
"description": "GettableAlert gettable alert",
"properties": {
"annotations": {
"$ref": "#/definitions/labelSet"
Expand Down Expand Up @@ -4693,13 +4782,13 @@
"type": "object"
},
"gettableAlerts": {
"description": "GettableAlerts gettable alerts",
"items": {
"$ref": "#/definitions/gettableAlert"
},
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down Expand Up @@ -4755,7 +4844,6 @@
"type": "array"
},
"integration": {
"description": "Integration integration",
"properties": {
"lastNotifyAttempt": {
"description": "A timestamp indicating the last attempt to deliver a notification regardless of the outcome.\nFormat: date-time",
Expand Down Expand Up @@ -4936,6 +5024,7 @@
"type": "object"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"active": {
"description": "active",
Expand Down
Loading

0 comments on commit d4350cf

Please sign in to comment.