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 Aug 26, 2024
1 parent 6d4f610 commit f6b4ccf
Show file tree
Hide file tree
Showing 3 changed files with 359 additions and 82 deletions.
143 changes: 117 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 @@ -4270,6 +4358,7 @@
"type": "object"
},
"URL": {
"description": "The general form represented is:\n\n[scheme:][//[userinfo@]host][/]path[?query][#fragment]\n\nURLs that do not start with a slash after the scheme are interpreted as:\n\nscheme:opaque[?query][#fragment]\n\nNote that the Path field is stored in decoded form: /%47%6f%2f becomes /Go/.\nA consequence is that it is impossible to tell which slashes in the Path were\nslashes in the raw URL and which were %2f. This distinction is rarely important,\nbut when it is, the code should use the EscapedPath method, which preserves\nthe original encoding of Path.\n\nThe RawPath field is an optional field which is only set when the default\nencoding of Path is different from the escaped path. See the EscapedPath method\nfor more details.\n\nURL's String method uses the EscapedPath method to obtain the path.",
"properties": {
"ForceQuery": {
"type": "boolean"
Expand Down Expand Up @@ -4305,7 +4394,7 @@
"$ref": "#/definitions/Userinfo"
}
},
"title": "URL is a custom URL type that allows validation at configuration load time.",
"title": "A URL represents a parsed URL (technically, a URI reference).",
"type": "object"
},
"UpdateRuleGroupResponse": {
Expand Down Expand Up @@ -4358,7 +4447,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 @@ -4534,6 +4623,7 @@
"type": "object"
},
"alertGroups": {
"description": "AlertGroups alert groups",
"items": {
"$ref": "#/definitions/alertGroup"
},
Expand Down Expand Up @@ -4700,6 +4790,7 @@
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down Expand Up @@ -4748,7 +4839,6 @@
"type": "object"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},
Expand Down Expand Up @@ -4899,6 +4989,7 @@
"type": "array"
},
"postableSilence": {
"description": "PostableSilence postable silence",
"properties": {
"comment": {
"description": "comment",
Expand Down
Loading

0 comments on commit f6b4ccf

Please sign in to comment.