Alerting: Support custom annotations and labels when testing contact points

Support custom annotations and labels when testing contact points
This commit is contained in:
George Robinson
2021-10-21 13:47:06 +01:00
committed by GitHub
parent 3abb355364
commit 967721068e
6 changed files with 591 additions and 130 deletions
+44 -6
View File
@@ -493,6 +493,14 @@
"summary": "Test Grafana managed receivers without saving them.",
"operationId": "RoutePostTestReceivers",
"parameters": [
{
"x-go-name": "Alert",
"name": "alert",
"in": "body",
"schema": {
"$ref": "#/definitions/TestReceiversConfigAlertParams"
}
},
{
"x-go-name": "Receivers",
"name": "receivers",
@@ -2090,6 +2098,19 @@
},
"x-go-package": "github.com/prometheus/common/model"
},
"LabelSet": {
"description": "A LabelSet is a collection of LabelName and LabelValue pairs. The LabelSet\nmay be fully-qualified down to the point where it may resolve to a single\nMetric in the data store or not. All operations that occur within the realm\nof a LabelSet can emit a vector of Metric entities to which the LabelSet may\nmatch.",
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/LabelValue"
},
"x-go-package": "github.com/prometheus/common/model"
},
"LabelValue": {
"type": "string",
"title": "A LabelValue is an associated value for a LabelName.",
"x-go-package": "github.com/prometheus/common/model"
},
"Labels": {
"description": "Labels is a sorted set of labels. Order has to be guaranteed upon\ninstantiation.",
"type": "array",
@@ -3429,13 +3450,28 @@
},
"x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
},
"TestReceiversConfigAlertParams": {
"type": "object",
"properties": {
"annotations": {
"$ref": "#/definitions/LabelSet"
},
"labels": {
"$ref": "#/definitions/LabelSet"
}
},
"x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
},
"TestReceiversResult": {
"type": "object",
"properties": {
"alert": {
"$ref": "#/definitions/TestReceiversConfigAlertParams"
},
"notified_at": {
"type": "string",
"format": "date-time",
"x-go-name": "NotifedAt"
"x-go-name": "NotifiedAt"
},
"receivers": {
"type": "array",
@@ -3675,6 +3711,7 @@
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"alertGroup": {
"description": "AlertGroup alert group",
"type": "object",
"required": [
"alerts",
@@ -3697,8 +3734,6 @@
"$ref": "#/definitions/receiver"
}
},
"x-go-name": "AlertGroup",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models",
"$ref": "#/definitions/alertGroup"
},
"alertGroups": {
@@ -3899,7 +3934,6 @@
"$ref": "#/definitions/gettableAlerts"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"type": "object",
"required": [
"comment",
@@ -3952,14 +3986,17 @@
"x-go-name": "UpdatedAt"
}
},
"x-go-name": "GettableSilence",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models",
"$ref": "#/definitions/gettableSilence"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"type": "array",
"items": {
"$ref": "#/definitions/gettableSilence"
},
"x-go-name": "GettableSilences",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models",
"$ref": "#/definitions/gettableSilences"
},
"labelSet": {
@@ -4134,7 +4171,6 @@
"$ref": "#/definitions/postableSilence"
},
"receiver": {
"description": "Receiver receiver",
"type": "object",
"required": [
"name"
@@ -4146,6 +4182,8 @@
"x-go-name": "Name"
}
},
"x-go-name": "Receiver",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models",
"$ref": "#/definitions/receiver"
},
"silence": {