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
+48 -10
View File
@@ -1065,6 +1065,19 @@
"type": "array",
"x-go-package": "github.com/prometheus/common/model"
},
"LabelSet": {
"additionalProperties": {
"$ref": "#/definitions/LabelValue"
},
"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",
"x-go-package": "github.com/prometheus/common/model"
},
"LabelValue": {
"title": "A LabelValue is an associated value for a LabelName.",
"type": "string",
"x-go-package": "github.com/prometheus/common/model"
},
"Labels": {
"description": "Labels is a sorted set of labels. Order has to be guaranteed upon\ninstantiation.",
"items": {
@@ -2403,12 +2416,27 @@
"type": "object",
"x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
},
"TestReceiversConfigAlertParams": {
"properties": {
"annotations": {
"$ref": "#/definitions/LabelSet"
},
"labels": {
"$ref": "#/definitions/LabelSet"
}
},
"type": "object",
"x-go-package": "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
},
"TestReceiversResult": {
"properties": {
"alert": {
"$ref": "#/definitions/TestReceiversConfigAlertParams"
},
"notified_at": {
"format": "date-time",
"type": "string",
"x-go-name": "NotifedAt"
"x-go-name": "NotifiedAt"
},
"receivers": {
"items": {
@@ -2649,6 +2677,7 @@
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"alertGroup": {
"description": "AlertGroup alert group",
"properties": {
"alerts": {
"description": "alerts",
@@ -2670,9 +2699,7 @@
"labels",
"receiver"
],
"type": "object",
"x-go-name": "AlertGroup",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
"type": "object"
},
"alertGroups": {
"items": {
@@ -2869,7 +2896,6 @@
"type": "array"
},
"gettableSilence": {
"description": "GettableSilence gettable silence",
"properties": {
"comment": {
"description": "comment",
@@ -2921,14 +2947,17 @@
"status",
"updatedAt"
],
"type": "object"
"type": "object",
"x-go-name": "GettableSilence",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"gettableSilences": {
"description": "GettableSilences gettable silences",
"items": {
"$ref": "#/definitions/gettableSilence"
},
"type": "array"
"type": "array",
"x-go-name": "GettableSilences",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"labelSet": {
"additionalProperties": {
@@ -3101,7 +3130,6 @@
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"receiver": {
"description": "Receiver receiver",
"properties": {
"name": {
"description": "name",
@@ -3112,7 +3140,9 @@
"required": [
"name"
],
"type": "object"
"type": "object",
"x-go-name": "Receiver",
"x-go-package": "github.com/prometheus/alertmanager/api/v2/models"
},
"silence": {
"description": "Silence silence",
@@ -3699,6 +3729,14 @@
"post": {
"operationId": "RoutePostTestReceivers",
"parameters": [
{
"in": "body",
"name": "alert",
"schema": {
"$ref": "#/definitions/TestReceiversConfigAlertParams"
},
"x-go-name": "Alert"
},
{
"in": "body",
"name": "receivers",