Onboard Argus alert configs (#449)
* Onboard Argus alert config receivers (#439) * initial schema and to payload * finish receiver resource implementation (schema, topayload and mapfields) * fix toUpdate payload lists * fix resource and datasource on alert config attr removal, add testing * fix linting and testing * initial test map fields * improve testing, remove logging * rename vars in acc testing * refactor mapAlertConfig * improve mock alert config, fix testing * make the mock alert config receivers match the default * generate docs * Onboard Argus Alert Config global configuration (#446) * initial implementation * initial map fields * extend datasource, finish resource impl and extend acc testing * remove unmapped fields * add all attributes back * remove commented inhibit rules * generate docs, fix testing * address PR comments * Onboard Alert Config route (#447) * Initial implementation * add schema to datasource, improve acc testing * fix linting, generate docs * address PR comments * fix and improve acceptance tests * update test titles (comments) * address acceptance comments (#452) * Onboard Argus Alert Config child routes in Route (#463) * initial schema and map fields implementation * initial working solution * improve implementation, generate docs * fix description, add more unit testing * address PR comments * add unit and acc testing, fix datasource schema, fix plan_id mapping * add checks to acceptance testing * update acceptance tests
This commit is contained in:
parent
f762c4800b
commit
a35b887315
8 changed files with 3081 additions and 9 deletions
|
|
@ -30,6 +30,7 @@ data "stackit_argus_instance" "example" {
|
|||
### Read-Only
|
||||
|
||||
- `acl` (Set of String) The access control list for this instance. Each entry is an IP address range that is permitted to access, in CIDR notation.
|
||||
- `alert_config` (Attributes) Alert configuration for the instance. (see [below for nested schema](#nestedatt--alert_config))
|
||||
- `alerting_url` (String) Specifies Alerting URL.
|
||||
- `dashboard_url` (String) Specifies Argus instance dashboard URL.
|
||||
- `grafana_initial_admin_password` (String, Sensitive) Specifies an initial Grafana admin password.
|
||||
|
|
@ -54,3 +55,97 @@ data "stackit_argus_instance" "example" {
|
|||
- `plan_name` (String) Specifies the Argus plan. E.g. `Monitoring-Medium-EU01`.
|
||||
- `targets_url` (String) Specifies Targets URL.
|
||||
- `zipkin_spans_url` (String)
|
||||
|
||||
<a id="nestedatt--alert_config"></a>
|
||||
### Nested Schema for `alert_config`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `global` (Attributes) Global configuration for the alerts. (see [below for nested schema](#nestedatt--alert_config--global))
|
||||
- `receivers` (Attributes List) List of alert receivers. (see [below for nested schema](#nestedatt--alert_config--receivers))
|
||||
- `route` (Attributes) The route for the alert. (see [below for nested schema](#nestedatt--alert_config--route))
|
||||
|
||||
<a id="nestedatt--alert_config--global"></a>
|
||||
### Nested Schema for `alert_config.global`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `opsgenie_api_key` (String, Sensitive) The API key for OpsGenie.
|
||||
- `opsgenie_api_url` (String) The host to send OpsGenie API requests to. Must be a valid URL
|
||||
- `resolve_timeout` (String) The default value used by alertmanager if the alert does not include EndsAt. After this time passes, it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt.
|
||||
- `smtp_auth_identity` (String) SMTP authentication information. Must be a valid email address
|
||||
- `smtp_auth_password` (String, Sensitive) SMTP Auth using LOGIN and PLAIN.
|
||||
- `smtp_auth_username` (String) SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server.
|
||||
- `smtp_from` (String) The default SMTP From header field. Must be a valid email address
|
||||
- `smtp_smart_host` (String) The default SMTP smarthost used for sending emails, including port number. Port number usually is 25, or 587 for SMTP over TLS (sometimes referred to as STARTTLS).
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--receivers"></a>
|
||||
### Nested Schema for `alert_config.receivers`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `email_configs` (Attributes List) List of email configurations. (see [below for nested schema](#nestedatt--alert_config--receivers--email_configs))
|
||||
- `name` (String) Name of the receiver.
|
||||
- `opsgenie_configs` (Attributes List) List of OpsGenie configurations. (see [below for nested schema](#nestedatt--alert_config--receivers--opsgenie_configs))
|
||||
- `webhooks_configs` (Attributes List) List of Webhooks configurations. (see [below for nested schema](#nestedatt--alert_config--receivers--webhooks_configs))
|
||||
|
||||
<a id="nestedatt--alert_config--receivers--email_configs"></a>
|
||||
### Nested Schema for `alert_config.receivers.email_configs`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `auth_identity` (String) SMTP authentication information. Must be a valid email address
|
||||
- `auth_password` (String) SMTP authentication password.
|
||||
- `auth_username` (String) SMTP authentication username.
|
||||
- `from` (String) The sender email address. Must be a valid email address
|
||||
- `smart_host` (String) The SMTP host through which emails are sent.
|
||||
- `to` (String) The email address to send notifications to. Must be a valid email address
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--receivers--opsgenie_configs"></a>
|
||||
### Nested Schema for `alert_config.receivers.opsgenie_configs`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `api_key` (String) The API key for OpsGenie.
|
||||
- `api_url` (String) The host to send OpsGenie API requests to. Must be a valid URL
|
||||
- `tags` (String) Comma separated list of tags attached to the notifications.
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--receivers--webhooks_configs"></a>
|
||||
### Nested Schema for `alert_config.receivers.webhooks_configs`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `ms_teams` (Boolean) Microsoft Teams webhooks require special handling, set this to true if the webhook is for Microsoft Teams.
|
||||
- `url` (String) The endpoint to send HTTP POST requests to. Must be a valid URL
|
||||
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--route"></a>
|
||||
### Nested Schema for `alert_config.route`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `group_by` (List of String) The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.
|
||||
- `group_interval` (String) How long to wait before sending a notification about new alerts that are added to a group of alerts for which an initial notification has already been sent. (Usually ~5m or more.)
|
||||
- `group_wait` (String) How long to initially wait to send a notification for a group of alerts. Allows to wait for an inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.) .
|
||||
- `match` (Map of String) A set of equality matchers an alert has to fulfill to match the node.
|
||||
- `match_regex` (Map of String) A set of regex-matchers an alert has to fulfill to match the node.
|
||||
- `receiver` (String) The name of the receiver to route the alerts to.
|
||||
- `repeat_interval` (String) How long to wait before sending a notification again if it has already been sent successfully for an alert. (Usually ~3h or more).
|
||||
- `routes` (Attributes List) List of child routes. (see [below for nested schema](#nestedatt--alert_config--route--routes))
|
||||
|
||||
<a id="nestedatt--alert_config--route--routes"></a>
|
||||
### Nested Schema for `alert_config.route.routes`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `group_by` (List of String) The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.
|
||||
- `group_interval` (String) How long to wait before sending a notification about new alerts that are added to a group of alerts for which an initial notification has already been sent. (Usually ~5m or more.)
|
||||
- `group_wait` (String) How long to initially wait to send a notification for a group of alerts. Allows to wait for an inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.)
|
||||
- `match` (Map of String) A set of equality matchers an alert has to fulfill to match the node.
|
||||
- `match_regex` (Map of String) A set of regex-matchers an alert has to fulfill to match the node.
|
||||
- `receiver` (String) The name of the receiver to route the alerts to.
|
||||
- `repeat_interval` (String) How long to wait before sending a notification again if it has already been sent successfully for an alert. (Usually ~3h or more).
|
||||
|
|
|
|||
|
|
@ -36,6 +36,7 @@ resource "stackit_argus_instance" "example" {
|
|||
### Optional
|
||||
|
||||
- `acl` (Set of String) The access control list for this instance. Each entry is an IP address range that is permitted to access, in CIDR notation.
|
||||
- `alert_config` (Attributes) Alert configuration for the instance. (see [below for nested schema](#nestedatt--alert_config))
|
||||
- `metrics_retention_days` (Number) Specifies for how many days the raw metrics are kept.
|
||||
- `metrics_retention_days_1h_downsampling` (Number) Specifies for how many days the 1h downsampled metrics are kept. must be less than the value of the 5m downsampling retention. Default is set to `0` (disabled).
|
||||
- `metrics_retention_days_5m_downsampling` (Number) Specifies for how many days the 5m downsampled metrics are kept. must be less than the value of the general retention. Default is set to `0` (disabled).
|
||||
|
|
@ -62,3 +63,110 @@ resource "stackit_argus_instance" "example" {
|
|||
- `plan_id` (String) The Argus plan ID.
|
||||
- `targets_url` (String) Specifies Targets URL.
|
||||
- `zipkin_spans_url` (String)
|
||||
|
||||
<a id="nestedatt--alert_config"></a>
|
||||
### Nested Schema for `alert_config`
|
||||
|
||||
Required:
|
||||
|
||||
- `receivers` (Attributes List) List of alert receivers. (see [below for nested schema](#nestedatt--alert_config--receivers))
|
||||
- `route` (Attributes) Route configuration for the alerts. (see [below for nested schema](#nestedatt--alert_config--route))
|
||||
|
||||
Optional:
|
||||
|
||||
- `global` (Attributes) Global configuration for the alerts. (see [below for nested schema](#nestedatt--alert_config--global))
|
||||
|
||||
<a id="nestedatt--alert_config--receivers"></a>
|
||||
### Nested Schema for `alert_config.receivers`
|
||||
|
||||
Required:
|
||||
|
||||
- `name` (String) Name of the receiver.
|
||||
|
||||
Optional:
|
||||
|
||||
- `email_configs` (Attributes List) List of email configurations. (see [below for nested schema](#nestedatt--alert_config--receivers--email_configs))
|
||||
- `opsgenie_configs` (Attributes List) List of OpsGenie configurations. (see [below for nested schema](#nestedatt--alert_config--receivers--opsgenie_configs))
|
||||
- `webhooks_configs` (Attributes List) List of Webhooks configurations. (see [below for nested schema](#nestedatt--alert_config--receivers--webhooks_configs))
|
||||
|
||||
<a id="nestedatt--alert_config--receivers--email_configs"></a>
|
||||
### Nested Schema for `alert_config.receivers.email_configs`
|
||||
|
||||
Optional:
|
||||
|
||||
- `auth_identity` (String) SMTP authentication information. Must be a valid email address
|
||||
- `auth_password` (String) SMTP authentication password.
|
||||
- `auth_username` (String) SMTP authentication username.
|
||||
- `from` (String) The sender email address. Must be a valid email address
|
||||
- `smart_host` (String) The SMTP host through which emails are sent.
|
||||
- `to` (String) The email address to send notifications to. Must be a valid email address
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--receivers--opsgenie_configs"></a>
|
||||
### Nested Schema for `alert_config.receivers.opsgenie_configs`
|
||||
|
||||
Optional:
|
||||
|
||||
- `api_key` (String) The API key for OpsGenie.
|
||||
- `api_url` (String) The host to send OpsGenie API requests to. Must be a valid URL
|
||||
- `tags` (String) Comma separated list of tags attached to the notifications.
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--receivers--webhooks_configs"></a>
|
||||
### Nested Schema for `alert_config.receivers.webhooks_configs`
|
||||
|
||||
Optional:
|
||||
|
||||
- `ms_teams` (Boolean) Microsoft Teams webhooks require special handling, set this to true if the webhook is for Microsoft Teams.
|
||||
- `url` (String) The endpoint to send HTTP POST requests to. Must be a valid URL
|
||||
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--route"></a>
|
||||
### Nested Schema for `alert_config.route`
|
||||
|
||||
Required:
|
||||
|
||||
- `receiver` (String) The name of the receiver to route the alerts to.
|
||||
|
||||
Optional:
|
||||
|
||||
- `group_by` (List of String) The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.
|
||||
- `group_interval` (String) How long to wait before sending a notification about new alerts that are added to a group of alerts for which an initial notification has already been sent. (Usually ~5m or more.)
|
||||
- `group_wait` (String) How long to initially wait to send a notification for a group of alerts. Allows to wait for an inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.)
|
||||
- `match` (Map of String) A set of equality matchers an alert has to fulfill to match the node.
|
||||
- `match_regex` (Map of String) A set of regex-matchers an alert has to fulfill to match the node.
|
||||
- `repeat_interval` (String) How long to wait before sending a notification again if it has already been sent successfully for an alert. (Usually ~3h or more).
|
||||
- `routes` (Attributes List) List of child routes. (see [below for nested schema](#nestedatt--alert_config--route--routes))
|
||||
|
||||
<a id="nestedatt--alert_config--route--routes"></a>
|
||||
### Nested Schema for `alert_config.route.routes`
|
||||
|
||||
Required:
|
||||
|
||||
- `receiver` (String) The name of the receiver to route the alerts to.
|
||||
|
||||
Optional:
|
||||
|
||||
- `group_by` (List of String) The labels by which incoming alerts are grouped together. For example, multiple alerts coming in for cluster=A and alertname=LatencyHigh would be batched into a single group. To aggregate by all possible labels use the special value '...' as the sole label name, for example: group_by: ['...']. This effectively disables aggregation entirely, passing through all alerts as-is. This is unlikely to be what you want, unless you have a very low alert volume or your upstream notification system performs its own grouping.
|
||||
- `group_interval` (String) How long to wait before sending a notification about new alerts that are added to a group of alerts for which an initial notification has already been sent. (Usually ~5m or more.)
|
||||
- `group_wait` (String) How long to initially wait to send a notification for a group of alerts. Allows to wait for an inhibiting alert to arrive or collect more initial alerts for the same group. (Usually ~0s to few minutes.)
|
||||
- `match` (Map of String) A set of equality matchers an alert has to fulfill to match the node.
|
||||
- `match_regex` (Map of String) A set of regex-matchers an alert has to fulfill to match the node.
|
||||
- `repeat_interval` (String) How long to wait before sending a notification again if it has already been sent successfully for an alert. (Usually ~3h or more).
|
||||
|
||||
|
||||
|
||||
<a id="nestedatt--alert_config--global"></a>
|
||||
### Nested Schema for `alert_config.global`
|
||||
|
||||
Optional:
|
||||
|
||||
- `opsgenie_api_key` (String, Sensitive) The API key for OpsGenie.
|
||||
- `opsgenie_api_url` (String) The host to send OpsGenie API requests to. Must be a valid URL
|
||||
- `resolve_timeout` (String) The default value used by alertmanager if the alert does not include EndsAt. After this time passes, it can declare the alert as resolved if it has not been updated. This has no impact on alerts from Prometheus, as they always include EndsAt.
|
||||
- `smtp_auth_identity` (String) SMTP authentication information. Must be a valid email address
|
||||
- `smtp_auth_password` (String, Sensitive) SMTP Auth using LOGIN and PLAIN.
|
||||
- `smtp_auth_username` (String) SMTP Auth using CRAM-MD5, LOGIN and PLAIN. If empty, Alertmanager doesn't authenticate to the SMTP server.
|
||||
- `smtp_from` (String) The default SMTP From header field. Must be a valid email address
|
||||
- `smtp_smart_host` (String) The default SMTP smarthost used for sending emails, including port number in format `host:port` (eg. `smtp.example.com:587`). Port number usually is 25, or 587 for SMTP over TLS (sometimes referred to as STARTTLS).
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue