You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: supports new notifier_id attribute in alert configuration notifications (#1514)
* fix: alert configuration data source nil pointer with third party notifications
* modify all third party notifications to use fake credentials so acceptance tests are run in CI
* extract dummy keys to common variables
* remove usage of project id env variable in third party alert configuration tests
* feat: supports new notifier_id attribute in alert configuration notifications
* temprary change to use atlas go sdk version with changes
* docs: align documentation of alert config singular data source with plural data source
* fix merge conflict resolution
* update atlas sdk to 0.34.0
* addressing docs PR comments
Copy file name to clipboardExpand all lines: examples/atlas-alert-configurations/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,6 +14,8 @@ chmod +x ./import-alerts.sh
14
14
terraform apply
15
15
```
16
16
17
+
**NOTE**: Third-party notifications will not contain their respective credentials as these are sensitive attributes. If you wish to perform updates on these notifications without providing the original credentials, the corresponding `notifier_id` attribute must be provided instead.
18
+
17
19
## Contingency Plans
18
20
If unhappy with the resource file or imports, here are some things that can be done:
Copy file name to clipboardExpand all lines: website/docs/d/alert_configuration.html.markdown
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -121,8 +121,12 @@ In addition to all arguments above, the following attributes are exported:
121
121
*`updated` - Timestamp in ISO 8601 date and time format in UTC when this alert configuration was last updated.
122
122
*`enabled` - If set to true, the alert configuration is enabled. If enabled is not exported it is set to false.
123
123
*`event_type` - The type of event that will trigger an alert.
124
+
*`matcher` - Rules to apply when matching an object against this alert configuration. See [matchers](#matchers).
125
+
*`metric_threshold_config` - The threshold that causes an alert to be triggered. Required if `event_type_name` : `OUTSIDE_METRIC_THRESHOLD` or `OUTSIDE_SERVERLESS_METRIC_THRESHOLD`. See [metric threshold config](#metric-threshold-config).
126
+
*`threshold_config` - Threshold that triggers an alert. Required if `event_type_name` is any value other than `OUTSIDE_METRIC_THRESHOLD` or `OUTSIDE_SERVERLESS_METRIC_THRESHOLD`. See [threshold config](#threshold-config).
127
+
*`notifications` - List of notifications to send when an alert condition is detected. See [notifications](#notifications).
124
128
125
-
-> ***IMPORTANT:*** Event Type has many possible values. All current options at available at https://docs.atlas.mongodb.com/reference/api/alert-configurations-create-config/Details for both conditional and metric based alerts can be found by selecting the tabs on the [alert config page](https://docs.atlas.mongodb.com/reference/api/alert-configurations-create-config/) and checking the latest eventTypeName options.
129
+
-> ***IMPORTANT:*** Event Type has many possible values. Details for both conditional and metric based alerts can be found by selecting the tabs on the [alert config page](https://www.mongodb.com/docs/atlas/reference/api-resources-spec/v2/#tag/Alert-Configurations/operation/createAlertConfiguration) and checking the latest eventTypeName options.
126
130
127
131
-> **NOTE:** If `event_type` is set to `OUTSIDE_METRIC_THRESHOLD` or `OUTSIDE_SERVERLESS_METRIC_THRESHOLD`, the `metric_threshold_config` field must also be configured.
128
132
@@ -163,12 +167,12 @@ Rules to apply when matching an object against this alert configuration. Only en
The threshold that causes an alert to be triggered. Required if `event_type_name` : `OUTSIDE_METRIC_THRESHOLD` or `OUTSIDE_SERVERLESS_METRIC_THRESHOLD`.
168
172
169
173
*`metric_name` - Name of the metric to check. The full list being quite large, please refer to atlas docs [here for general metrics](https://docs.atlas.mongodb.com/reference/alert-host-metrics/#measurement-types) and [here for serverless metrics](https://www.mongodb.com/docs/atlas/reference/api/alert-configurations-create-config/#serverless-measurements)
170
174
171
-
*`operator` - Operator to apply when checking the current metric value against the threshold value.
175
+
*`operator` - The operator to apply when checking the current metric value against the threshold value.
172
176
Accepted values are:
173
177
-`GREATER_THAN`
174
178
-`LESS_THAN`
@@ -178,8 +182,8 @@ The threshold that causes an alert to be triggered. Required if `event_type_name
178
182
Refer to the [MongoDB API Alert Configuration documentation](https://www.mongodb.com/docs/atlas/reference/api/alert-configurations-get-config/#request-body-parameters) for a list of accepted values.
179
183
*`mode` - This must be set to AVERAGE. Atlas computes the current metric value as an average.
180
184
181
-
### Threshold Config (`threshold_config`)
182
-
*`operator` - Operator to apply when checking the current metric value against the threshold value.
185
+
### Threshold Config
186
+
*`operator` - The operator to apply when checking the current metric value against the threshold value.
183
187
Accepted values are:
184
188
-`GREATER_THAN`
185
189
-`LESS_THAN`
@@ -199,7 +203,7 @@ Notifications to send when an alert condition is detected.
199
203
*`email_address` - Email address to which alert notifications are sent. Required for the EMAIL notifications type.
200
204
*`email_enabled` - Flag indicating email notifications should be sent. Atlas returns this value if `type_name` is set to `ORG`, `GROUP`, or `USER`.
201
205
*`flowdock_api_token` - The Flowdock personal API token. Required for the `FLOWDOCK` notifications type. If the token later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
202
-
*`flow_name` - Flowdock flow name in lower-case letters. Required for the `FLOWDOCK` notifications type
206
+
*`flow_name` - Flowdock flow name in lower-case letters. Required for the `FLOWDOCK` notifications type.
203
207
*`interval_min` - Number of minutes to wait between successive notifications for unacknowledged alerts that are not resolved. The minimum value is 5.
204
208
*`mobile_number` - Mobile number to which alert notifications are sent. Required for the SMS notifications type.
205
209
*`ops_genie_api_key` - Opsgenie API Key. Required for the `OPS_GENIE` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the token.
@@ -226,13 +230,13 @@ Notifications to send when an alert condition is detected.
226
230
-`WEBHOOK`
227
231
-`MICROSOFT_TEAMS`
228
232
233
+
*`notifier_id` - The notifier id is a system-generated unique identifier assigned to each notification method. This is needed when updating third-party notifications without requiring explicit authentication credentials.
229
234
*`username` - Name of the Atlas user to which to send notifications. Only a user in the project that owns the alert configuration is allowed here. Required for the `USER` notifications type.
230
235
*`victor_ops_api_key` - VictorOps API key. Required for the `VICTOR_OPS` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
231
236
*`victor_ops_routing_key` - VictorOps routing key. Optional for the `VICTOR_OPS` notifications type. If the key later becomes invalid, Atlas sends an email to the project owner and eventually removes the key.
232
237
*`webhook_secret` - Authentication secret for the `WEBHOOK` notifications type.
233
238
*`webhook_url` - Target URL for the `WEBHOOK` notifications type.
234
239
*`microsoft_teams_webhook_url` - Microsoft Teams channel incoming webhook URL. Required for the `MICROSOFT_TEAMS` notifications type.
235
-
236
240
*`roles` - Atlas role in current Project or Organization. Atlas returns this value if you set `type_name` to `ORG` or `GROUP`.
237
241
238
242
See detailed information for arguments and attributes: [MongoDB API Alert Configuration](https://docs.atlas.mongodb.com/reference/api/alert-configurations-get-config/)
0 commit comments