diff --git a/Documentation/api.md b/Documentation/api.md index 1ae0116838e..f7036484fe6 100644 --- a/Documentation/api.md +++ b/Documentation/api.md @@ -1468,6 +1468,7 @@ OpsGenieConfig configures notifications via OpsGenie. See https://prometheus.io/ | details | A set of arbitrary key/value pairs that provide further detail about the incident. | [][KeyValue](#keyvalue) | false | | responders | List of responders responsible for notifications. | [][OpsGenieConfigResponder](#opsgenieconfigresponder) | false | | httpConfig | HTTP client configuration. | *[HTTPConfig](#httpconfig) | false | +| updateAlerts | Update alert descritpion on change. | bool | false | [Back to TOC](#table-of-contents) diff --git a/bundle.yaml b/bundle.yaml index 8a0ecfbc991..27e2cebb665 100644 --- a/bundle.yaml +++ b/bundle.yaml @@ -773,6 +773,9 @@ spec: description: Comma separated list of tags attached to the notifications. type: string + updateAlerts: + description: Update alert descritpion on change. + type: boolean type: object type: array pagerdutyConfigs: diff --git a/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml b/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml index 457617278b1..8f064dd2b72 100644 --- a/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml +++ b/example/prometheus-operator-crd/monitoring.coreos.com_alertmanagerconfigs.yaml @@ -773,6 +773,9 @@ spec: description: Comma separated list of tags attached to the notifications. type: string + updateAlerts: + description: Update alert descritpion on change. + type: boolean type: object type: array pagerdutyConfigs: diff --git a/jsonnet/prometheus-operator/alertmanagerconfigs-crd.json b/jsonnet/prometheus-operator/alertmanagerconfigs-crd.json index 7c9a5d912cc..03874418e54 100644 --- a/jsonnet/prometheus-operator/alertmanagerconfigs-crd.json +++ b/jsonnet/prometheus-operator/alertmanagerconfigs-crd.json @@ -830,6 +830,10 @@ "tags": { "description": "Comma separated list of tags attached to the notifications.", "type": "string" + }, + "updateAlerts": { + "description": "Update alert descritpion on change.", + "type": "boolean" } }, "type": "object" diff --git a/pkg/alertmanager/.types.go.swp b/pkg/alertmanager/.types.go.swp new file mode 100644 index 00000000000..f7a2dca56eb Binary files /dev/null and b/pkg/alertmanager/.types.go.swp differ diff --git a/pkg/alertmanager/amcfg.go b/pkg/alertmanager/amcfg.go index 94e4f9727cc..cf315b3aec6 100644 --- a/pkg/alertmanager/amcfg.go +++ b/pkg/alertmanager/amcfg.go @@ -655,6 +655,7 @@ func (cg *configGenerator) convertOpsgenieConfig(ctx context.Context, in monitor Tags: in.Tags, Note: in.Note, Priority: in.Priority, + UpdateAlerts: in.UpdateAlerts, } if in.APIKey != nil { diff --git a/pkg/alertmanager/types.go b/pkg/alertmanager/types.go index a3aef4d479d..7d581200cc0 100644 --- a/pkg/alertmanager/types.go +++ b/pkg/alertmanager/types.go @@ -141,6 +141,7 @@ type opsgenieConfig struct { Tags string `yaml:"tags,omitempty" json:"tags,omitempty"` Note string `yaml:"note,omitempty" json:"note,omitempty"` Priority string `yaml:"priority,omitempty" json:"priority,omitempty"` + UpdateAlerts bool `yaml:"update_alerts,omitempty" json:"update_alerts,omitempty"` } type weChatConfig struct { diff --git a/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go b/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go index 5942880168a..b44da1c2458 100644 --- a/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go +++ b/pkg/apis/monitoring/v1alpha1/alertmanager_config_types.go @@ -482,6 +482,9 @@ type OpsGenieConfig struct { // HTTP client configuration. // +optional HTTPConfig *HTTPConfig `json:"httpConfig,omitempty"` + // Update alert descritpion on change. + // +optional + UpdateAlerts bool `json:"updateAlerts,omitempty"` } // Validate ensures OpsGenieConfig is valid