Skip to content

Commit 605d258

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Monitors Augmented Query Add Group By Source (DataDog#3357)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent ee56877 commit 605d258

4 files changed

Lines changed: 35 additions & 7 deletions

File tree

.generator/schemas/v1/openapi.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8303,6 +8303,10 @@ components:
83038303
description: The name assigned to this aggregation, when multiple aggregations are defined for a query.
83048304
example: "compute_result"
83058305
type: string
8306+
source:
8307+
description: Source reference for composite query payloads.
8308+
example: "filter_query"
8309+
type: string
83068310
required:
83078311
- aggregation
83088312
type: object
@@ -8330,6 +8334,10 @@ components:
83308334
type: integer
83318335
sort:
83328336
$ref: "#/components/schemas/MonitorFormulaAndFunctionEventQueryGroupBySort"
8337+
source:
8338+
description: Source reference for composite query payloads.
8339+
example: "filter_query"
8340+
type: string
83338341
required:
83348342
- facet
83358343
type: object

features/v1/monitors.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Feature: Monitors
219219
Scenario: Edit a monitor returns "Bad Request" response
220220
Given new "UpdateMonitor" request
221221
And request contains "monitor_id" parameter from "REPLACE.ME"
222-
And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"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, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "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", "name": "compute_result"}, "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"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
222+
And body with value {"assets": [{"category": "runbook", "name": "Monitor Runbook", "resource_key": "12345", "resource_type": "notebook", "url": "/notebooks/12345"}], "draft_status": "published", "options": {"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, "notification_preset_name": "show_all", "notify_audit": false, "notify_by": [], "on_missing_data": "default", "renotify_interval": null, "renotify_occurrences": null, "renotify_statuses": ["alert"], "scheduling_options": {"custom_schedule": {"recurrences": [{"rrule": "FREQ=WEEKLY;BYDAY=MO,TU,WE,TH,FR", "start": "2023-08-31T16:30:00", "timezone": "Europe/Paris"}]}, "evaluation_window": {"day_starts": "04:00", "hour_starts": 0, "month_starts": 1, "timezone": "Europe/Paris"}}, "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", "name": "compute_result", "source": "filter_query"}, "data_source": "rum", "group_by": [{"facet": "status", "limit": 10, "sort": {"aggregation": "avg", "order": "desc"}, "source": "filter_query"}], "indexes": ["days-3", "days-7"], "name": "query_errors", "search": {"query": "service:query"}}]}, "priority": null, "restricted_roles": [], "tags": [], "type": "query alert"}
223223
When the request is sent
224224
Then the response status is 400 Bad Request
225225

lib/datadog_api_client/v1/models/monitor_formula_and_function_event_query_definition_compute.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ class MonitorFormulaAndFunctionEventQueryDefinitionCompute
3333
# The name assigned to this aggregation, when multiple aggregations are defined for a query.
3434
attr_accessor :name
3535

36+
# Source reference for composite query payloads.
37+
attr_accessor :source
38+
3639
attr_accessor :additional_properties
3740

3841
# Attribute mapping from ruby-style variable name to JSON key.
@@ -42,7 +45,8 @@ def self.attribute_map
4245
:'aggregation' => :'aggregation',
4346
:'interval' => :'interval',
4447
:'metric' => :'metric',
45-
:'name' => :'name'
48+
:'name' => :'name',
49+
:'source' => :'source'
4650
}
4751
end
4852

@@ -53,7 +57,8 @@ def self.openapi_types
5357
:'aggregation' => :'MonitorFormulaAndFunctionEventAggregation',
5458
:'interval' => :'Integer',
5559
:'metric' => :'String',
56-
:'name' => :'String'
60+
:'name' => :'String',
61+
:'source' => :'String'
5762
}
5863
end
5964

@@ -90,6 +95,10 @@ def initialize(attributes = {})
9095
if attributes.key?(:'name')
9196
self.name = attributes[:'name']
9297
end
98+
99+
if attributes.key?(:'source')
100+
self.source = attributes[:'source']
101+
end
93102
end
94103

95104
# Check to see if the all the properties in the model are valid
@@ -140,14 +149,15 @@ def ==(o)
140149
interval == o.interval &&
141150
metric == o.metric &&
142151
name == o.name &&
152+
source == o.source &&
143153
additional_properties == o.additional_properties
144154
end
145155

146156
# Calculates hash code according to all attributes.
147157
# @return [Integer] Hash code
148158
# @!visibility private
149159
def hash
150-
[aggregation, interval, metric, name, additional_properties].hash
160+
[aggregation, interval, metric, name, source, additional_properties].hash
151161
end
152162
end
153163
end

lib/datadog_api_client/v1/models/monitor_formula_and_function_event_query_group_by.rb

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ class MonitorFormulaAndFunctionEventQueryGroupBy
3030
# Options for sorting group by results.
3131
attr_accessor :sort
3232

33+
# Source reference for composite query payloads.
34+
attr_accessor :source
35+
3336
attr_accessor :additional_properties
3437

3538
# Attribute mapping from ruby-style variable name to JSON key.
@@ -38,7 +41,8 @@ def self.attribute_map
3841
{
3942
:'facet' => :'facet',
4043
:'limit' => :'limit',
41-
:'sort' => :'sort'
44+
:'sort' => :'sort',
45+
:'source' => :'source'
4246
}
4347
end
4448

@@ -48,7 +52,8 @@ def self.openapi_types
4852
{
4953
:'facet' => :'String',
5054
:'limit' => :'Integer',
51-
:'sort' => :'MonitorFormulaAndFunctionEventQueryGroupBySort'
55+
:'sort' => :'MonitorFormulaAndFunctionEventQueryGroupBySort',
56+
:'source' => :'String'
5257
}
5358
end
5459

@@ -81,6 +86,10 @@ def initialize(attributes = {})
8186
if attributes.key?(:'sort')
8287
self.sort = attributes[:'sort']
8388
end
89+
90+
if attributes.key?(:'source')
91+
self.source = attributes[:'source']
92+
end
8493
end
8594

8695
# Check to see if the all the properties in the model are valid
@@ -130,14 +139,15 @@ def ==(o)
130139
facet == o.facet &&
131140
limit == o.limit &&
132141
sort == o.sort &&
142+
source == o.source &&
133143
additional_properties == o.additional_properties
134144
end
135145

136146
# Calculates hash code according to all attributes.
137147
# @return [Integer] Hash code
138148
# @!visibility private
139149
def hash
140-
[facet, limit, sort, additional_properties].hash
150+
[facet, limit, sort, source, additional_properties].hash
141151
end
142152
end
143153
end

0 commit comments

Comments
 (0)