Skip to content

Commit 4d212dd

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Regenerate client from commit 1358b465 of spec repo (#862)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent 138026d commit 4d212dd

File tree

8 files changed

+49
-17
lines changed

8 files changed

+49
-17
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.4",
7-
"regenerated": "2022-09-30 11:29:35.529283",
8-
"spec_repo_commit": "e6eb3136"
7+
"regenerated": "2022-10-03 13:35:17.264691",
8+
"spec_repo_commit": "1358b465"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2022-09-30 11:29:35.549126",
13-
"spec_repo_commit": "e6eb3136"
12+
"regenerated": "2022-10-03 13:35:17.277667",
13+
"spec_repo_commit": "1358b465"
1414
}
1515
}
1616
}

.generator/schemas/v1/openapi.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6278,6 +6278,24 @@ components:
62786278
description: A Boolean indicating whether tagged users is notified on changes
62796279
to this monitor.
62806280
type: boolean
6281+
notify_by:
6282+
description: 'Controls what granularity a monitor alerts on. Only available
6283+
for multi-alerts.
6284+
6285+
For instance, a monitor grouped by `cluster`, `namespace`, `pod` can be
6286+
configured to only notify on each
6287+
6288+
new `cluster` violating the alert conditions by setting `notify_by` to
6289+
`["cluster"]`. Tags mentioned
6290+
6291+
in `notify_by` have to be a subset of the grouping tags in the query.
6292+
6293+
For example, a query grouped by `cluster`, `namespace` cannot notify on
6294+
`region`.'
6295+
items:
6296+
description: A grouping tag.
6297+
type: string
6298+
type: array
62816299
notify_no_data:
62826300
default: false
62836301
description: A Boolean indicating whether this monitor notifies when data
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-08-15T18:04:46.756Z"
1+
"2022-09-30T16:41:33.797Z"

cassettes/v1/Monitors_4022238206/Validate-a-multi-alert-monitor-returns-OK-response_3334762130/recording.har

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"entries": [
1010
{
11-
"_id": "e34971e4a97d76f72fa0a6f1ecf342e2",
11+
"_id": "d52889849c4e433be88c072aa18bcf71",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
15-
"bodySize": 804,
15+
"bodySize": 834,
1616
"cookies": [],
1717
"headers": [
1818
{
@@ -32,17 +32,17 @@
3232
"postData": {
3333
"mimeType": "application/json",
3434
"params": [],
35-
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_a_multi_alert_monitor_returns_OK_response-1660586686\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"group_retention_duration\":\"2d\",\"groupby_simple_monitor\":false,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateamultialertmonitorreturnsokresponse1660586686\",\"env:ci\"],\"type\":\"log alert\"}"
35+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Validate_a_multi_alert_monitor_returns_OK_response-1664556093\",\"options\":{\"enable_logs_sample\":true,\"escalation_message\":\"the situation has escalated\",\"evaluation_delay\":700,\"group_retention_duration\":\"2d\",\"groupby_simple_monitor\":false,\"include_tags\":true,\"locked\":false,\"new_host_delay\":600,\"no_data_timeframe\":null,\"notify_audit\":false,\"notify_by\":[\"status\"],\"notify_no_data\":false,\"on_missing_data\":\"show_and_notify_no_data\",\"renotify_interval\":60,\"require_full_window\":true,\"thresholds\":{\"critical\":2,\"warning\":1},\"timeout_h\":24},\"priority\":3,\"query\":\"logs(\\\"service:foo AND type:error\\\").index(\\\"main\\\").rollup(\\\"count\\\").by(\\\"source,status\\\").last(\\\"5m\\\") > 2\",\"tags\":[\"test:testvalidateamultialertmonitorreturnsokresponse1664556093\",\"env:ci\"],\"type\":\"log alert\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/monitor/validate"
3939
},
4040
"response": {
41-
"bodySize": 2,
41+
"bodySize": 3,
4242
"content": {
4343
"mimeType": "application/json",
44-
"size": 2,
45-
"text": "{}"
44+
"size": 3,
45+
"text": "{}\n"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -51,14 +51,14 @@
5151
"value": "application/json"
5252
}
5353
],
54-
"headersSize": 611,
54+
"headersSize": 568,
5555
"httpVersion": "HTTP/1.1",
5656
"redirectURL": "",
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2022-08-15T18:04:46.760Z",
61-
"time": 355
60+
"startedDateTime": "2022-09-30T16:41:33.817Z",
61+
"time": 672
6262
}
6363
],
6464
"pages": [],

examples/v1/monitors/ValidateMonitor_4247196452.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const params: v1.MonitorsApiValidateMonitorRequest = {
1111
body: {
1212
name: "Example-Validate_a_multi_alert_monitor_returns_OK_response",
1313
type: "log alert",
14-
query: `logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2`,
14+
query: `logs("service:foo AND type:error").index("main").rollup("count").by("source,status").last("5m") > 2`,
1515
message: "some message Notify: @hipchat-channel",
1616
tags: ["test:examplevalidateamultialertmonitorreturnsokresponse", "env:ci"],
1717
priority: 3,
@@ -26,6 +26,7 @@ const params: v1.MonitorsApiValidateMonitorRequest = {
2626
newHostDelay: 600,
2727
noDataTimeframe: undefined,
2828
notifyAudit: false,
29+
notifyBy: ["status"],
2930
notifyNoData: false,
3031
onMissingData: "show_and_notify_no_data",
3132
renotifyInterval: 60,

features/v1/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Feature: Monitors
115115
Scenario: Edit a monitor returns "Bad Request" response
116116
Given new "UpdateMonitor" request
117117
And request contains "monitor_id" parameter from "REPLACE.ME"
118-
And body with value {"options": {"escalation_message": "none", "evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
118+
And body with value {"options": {"escalation_message": "none", "evaluation_delay": null, "include_tags": true, "min_failure_duration": 0, "min_location_failed": 1, "new_group_delay": null, "new_host_delay": 300, "no_data_timeframe": null, "notify_audit": false, "notify_by": [], "notify_no_data": false, "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "synthetics_check_id": null, "threshold_windows": {"recovery_window": null, "trigger_window": null}, "thresholds": {"critical_recovery": null, "ok": null, "unknown": null, "warning": null, "warning_recovery": null}, "timeout_h": null, "variables": [{"compute": {"aggregation": "avg", "interval": 60000, "metric": "@duration"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "restricted_roles": [], "tags": [], "type": "query alert"}
119119
When the request is sent
120120
Then the response status is 400 Bad Request
121121

features/v1/multi_alert_monitor_payload.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "{{ unique }}",
33
"type": "log alert",
4-
"query": "logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2",
4+
"query": "logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source,status\").last(\"5m\") > 2",
55
"message": "some message Notify: @hipchat-channel",
66
"tags": ["test:{{ unique_lower_alnum }}", "env:ci"],
77
"priority": 3,
@@ -16,6 +16,7 @@
1616
"new_host_delay": 600,
1717
"no_data_timeframe": null,
1818
"notify_audit": false,
19+
"notify_by": ["status"],
1920
"notify_no_data": false,
2021
"on_missing_data": "show_and_notify_no_data",
2122
"renotify_interval": 60,

packages/datadog-api-client-v1/models/MonitorOptions.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ export class MonitorOptions {
101101
* A Boolean indicating whether tagged users is notified on changes to this monitor.
102102
*/
103103
"notifyAudit"?: boolean;
104+
/**
105+
* Controls what granularity a monitor alerts on. Only available for multi-alerts.
106+
* For instance, a monitor grouped by `cluster`, `namespace`, `pod` can be configured to only notify on each
107+
* new `cluster` violating the alert conditions by setting `notify_by` to `["cluster"]`. Tags mentioned
108+
* in `notify_by` have to be a subset of the grouping tags in the query.
109+
* For example, a query grouped by `cluster`, `namespace` cannot notify on `region`.
110+
*/
111+
"notifyBy"?: Array<string>;
104112
/**
105113
* A Boolean indicating whether this monitor notifies when data stops reporting.
106114
*/
@@ -232,6 +240,10 @@ export class MonitorOptions {
232240
baseName: "notify_audit",
233241
type: "boolean",
234242
},
243+
notifyBy: {
244+
baseName: "notify_by",
245+
type: "Array<string>",
246+
},
235247
notifyNoData: {
236248
baseName: "notify_no_data",
237249
type: "boolean",

0 commit comments

Comments
 (0)