Skip to content

Commit 0f3778d

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Fix metric monitor test (#974)
Co-authored-by: ci.datadog-api-spec <[email protected]>
1 parent e459991 commit 0f3778d

File tree

5 files changed

+20
-20
lines changed

5 files changed

+20
-20
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": "2023-01-06 10:15:14.873059",
8-
"spec_repo_commit": "03622159"
7+
"regenerated": "2023-01-09 17:15:14.101086",
8+
"spec_repo_commit": "9f8d1169"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.4",
12-
"regenerated": "2023-01-06 10:15:14.885883",
13-
"spec_repo_commit": "03622159"
12+
"regenerated": "2023-01-09 17:15:14.116260",
13+
"spec_repo_commit": "9f8d1169"
1414
}
1515
}
1616
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
"2022-10-28T19:34:06.761Z"
1+
"2023-01-09T10:07:16.112Z"

cassettes/v1/Monitors_4022238206/Create-a-metric-monitor-returns-OK-response_281519646/recording.har

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
},
99
"entries": [
1010
{
11-
"_id": "936c156958cc755daaee683db8cd2021",
11+
"_id": "844db61d9078861e9fbf476be9c2efa1",
1212
"_order": 0,
1313
"cache": {},
1414
"request": {
15-
"bodySize": 320,
15+
"bodySize": 321,
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-Create_a_metric_monitor_returns_OK_response-1666985646\",\"options\":{\"scheduling_options\":{\"evaluation_window\":{\"day_starts\":\"04:00\",\"month_starts\":1}},\"thresholds\":{\"critical\":0.5}},\"query\":\"avg(current_1d):avg:system.load.5{*} > 0.5\",\"type\":\"metric alert\"}"
35+
"text": "{\"message\":\"some message Notify: @hipchat-channel\",\"name\":\"Test-Create_a_metric_monitor_returns_OK_response-1673258836\",\"options\":{\"scheduling_options\":{\"evaluation_window\":{\"day_starts\":\"04:00\",\"month_starts\":1}},\"thresholds\":{\"critical\":0.5}},\"query\":\"avg(current_1mo):avg:system.load.5{*} > 0.5\",\"type\":\"metric alert\"}"
3636
},
3737
"queryString": [],
3838
"url": "https://api.datadoghq.com/api/v1/monitor"
3939
},
4040
"response": {
41-
"bodySize": 799,
41+
"bodySize": 800,
4242
"content": {
4343
"mimeType": "application/json",
44-
"size": 799,
45-
"text": "{\"restricted_roles\":null,\"tags\":[],\"deleted\":null,\"query\":\"avg(current_1d):avg:system.load.5{*} > 0.5\",\"message\":\"some message Notify: @hipchat-channel\",\"id\":101334182,\"multi\":false,\"name\":\"Test-Create_a_metric_monitor_returns_OK_response-1666985646\",\"created\":\"2022-10-28T19:34:06.916192+00:00\",\"created_at\":1666985646000,\"creator\":{\"id\":1445416,\"handle\":\"[email protected]\",\"name\":null,\"email\":\"[email protected]\"},\"org_id\":321813,\"modified\":\"2022-10-28T19:34:06.916192+00:00\",\"priority\":null,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"type\":\"query alert\",\"options\":{\"notify_audit\":false,\"scheduling_options\":{\"evaluation_window\":{\"day_starts\":\"04:00\",\"month_starts\":1}},\"include_tags\":true,\"thresholds\":{\"critical\":0.5},\"silenced\":{},\"new_host_delay\":300,\"notify_no_data\":false}}\n"
44+
"size": 800,
45+
"text": "{\"id\":107235710,\"org_id\":321813,\"type\":\"query alert\",\"name\":\"Test-Create_a_metric_monitor_returns_OK_response-1673258836\",\"message\":\"some message Notify: @hipchat-channel\",\"tags\":[],\"query\":\"avg(current_1mo):avg:system.load.5{*} > 0.5\",\"options\":{\"scheduling_options\":{\"evaluation_window\":{\"day_starts\":\"04:00\",\"month_starts\":1}},\"thresholds\":{\"critical\":0.5},\"notify_no_data\":false,\"notify_audit\":false,\"new_host_delay\":300,\"include_tags\":true,\"silenced\":{}},\"multi\":false,\"created_at\":1673258836000,\"created\":\"2023-01-09T10:07:16.513455+00:00\",\"modified\":\"2023-01-09T10:07:16.513455+00:00\",\"deleted\":null,\"restricted_roles\":null,\"priority\":null,\"overall_state_modified\":null,\"overall_state\":\"No Data\",\"creator\":{\"name\":null,\"handle\":\"[email protected]\",\"email\":\"[email protected]\",\"id\":1445416}}\n"
4646
},
4747
"cookies": [],
4848
"headers": [
@@ -57,11 +57,11 @@
5757
"status": 200,
5858
"statusText": "OK"
5959
},
60-
"startedDateTime": "2022-10-28T19:34:06.778Z",
61-
"time": 180
60+
"startedDateTime": "2023-01-09T10:07:16.122Z",
61+
"time": 470
6262
},
6363
{
64-
"_id": "12513410df3146ac0022a43201da43ab",
64+
"_id": "60c288a40b63be85678439f439b9a9ff",
6565
"_order": 0,
6666
"cache": {},
6767
"request": {
@@ -78,14 +78,14 @@
7878
"httpVersion": "HTTP/1.1",
7979
"method": "DELETE",
8080
"queryString": [],
81-
"url": "https://api.datadoghq.com/api/v1/monitor/101334182"
81+
"url": "https://api.datadoghq.com/api/v1/monitor/107235710"
8282
},
8383
"response": {
8484
"bodySize": 33,
8585
"content": {
8686
"mimeType": "application/json",
8787
"size": 33,
88-
"text": "{\"deleted_monitor_id\":101334182}\n"
88+
"text": "{\"deleted_monitor_id\":107235710}\n"
8989
},
9090
"cookies": [],
9191
"headers": [
@@ -100,8 +100,8 @@
100100
"status": 200,
101101
"statusText": "OK"
102102
},
103-
"startedDateTime": "2022-10-28T19:34:06.969Z",
104-
"time": 156
103+
"startedDateTime": "2023-01-09T10:07:16.603Z",
104+
"time": 1328
105105
}
106106
],
107107
"pages": [],

examples/v1/monitors/CreateMonitor_2012680290.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const params: v1.MonitorsApiCreateMonitorRequest = {
1111
body: {
1212
name: "Example-Create_a_metric_monitor_returns_OK_response",
1313
type: "metric alert",
14-
query: "avg(current_1d):avg:system.load.5{*} > 0.5",
14+
query: "avg(current_1mo):avg:system.load.5{*} > 0.5",
1515
message: "some message Notify: @hipchat-channel",
1616
options: {
1717
thresholds: {

features/v1/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ Feature: Monitors
7070
@team:DataDog/monitor-app
7171
Scenario: Create a metric monitor returns "OK" response
7272
Given new "CreateMonitor" request
73-
And body with value {"name": "{{ unique }}", "type": "metric alert", "query": "avg(current_1d):avg:system.load.5{*} > 0.5", "message": "some message Notify: @hipchat-channel", "options":{"thresholds":{"critical":0.5}, "scheduling_options":{"evaluation_window":{"day_starts":"04:00", "month_starts":1}}}}
73+
And body with value {"name": "{{ unique }}", "type": "metric alert", "query": "avg(current_1mo):avg:system.load.5{*} > 0.5", "message": "some message Notify: @hipchat-channel", "options":{"thresholds":{"critical":0.5}, "scheduling_options":{"evaluation_window":{"day_starts":"04:00", "month_starts":1}}}}
7474
When the request is sent
7575
Then the response status is 200 OK
7676

0 commit comments

Comments
 (0)