Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate metric field of Security Monitoring Rules #1723

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.4",
"regenerated": "2022-10-14 14:06:52.995839",
"spec_repo_commit": "7eb6ca7a"
"regenerated": "2022-10-20 09:07:43.391926",
"spec_repo_commit": "148c906a"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-10-14 14:06:53.009989",
"spec_repo_commit": "7eb6ca7a"
"regenerated": "2022-10-20 09:07:43.404402",
"spec_repo_commit": "148c906a"
}
}
}
18 changes: 10 additions & 8 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8174,8 +8174,7 @@ components:
maximum: 9
type: integer
metrics:
description: Group of target fields to aggregate over when using the new
value aggregations.
description: Group of target fields to aggregate over.
items:
description: Field.
type: string
Expand Down Expand Up @@ -8278,8 +8277,7 @@ components:
example: d3f-ru1-e1d
type: string
metrics:
description: Group of target fields to aggregate over when using the new
value aggregations.
description: Group of target fields to aggregate over.
items:
description: Field.
type: string
Expand Down Expand Up @@ -8533,13 +8531,17 @@ components:
type: string
type: array
metric:
description: 'The target field to aggregate over when using the sum or max
deprecated: true
description: '(Deprecated) The target field to aggregate over when using
the sum or max

aggregations.'
aggregations. `metrics` field should be used instead.'
type: string
metrics:
description: Group of target fields to aggregate over when using the new
value aggregations.
description: Group of target fields to aggregate over when using the sum,
max, geo data, or new value aggregations. The sum, max, and geo data aggregations
only accept one value in this list, whereas the new value aggregation
accepts up to five values.
items:
description: Field.
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type SecurityMonitoringSignalRuleQuery struct {
CorrelatedByFields []string `json:"correlatedByFields,omitempty"`
// Index of the rule query used to retrieve the correlated field.
CorrelatedQueryIndex *int32 `json:"correlatedQueryIndex,omitempty"`
// Group of target fields to aggregate over when using the new value aggregations.
// Group of target fields to aggregate over.
Metrics []string `json:"metrics,omitempty"`
// Name of the query.
Name *string `json:"name,omitempty"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type SecurityMonitoringSignalRuleResponseQuery struct {
CorrelatedQueryIndex *int32 `json:"correlatedQueryIndex,omitempty"`
// Default Rule ID to match on signals.
DefaultRuleId *string `json:"defaultRuleId,omitempty"`
// Group of target fields to aggregate over when using the new value aggregations.
// Group of target fields to aggregate over.
Metrics []string `json:"metrics,omitempty"`
// Name of the query.
Name *string `json:"name,omitempty"`
Expand Down
10 changes: 7 additions & 3 deletions api/datadogV2/model_security_monitoring_standard_rule_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ type SecurityMonitoringStandardRuleQuery struct {
DistinctFields []string `json:"distinctFields,omitempty"`
// Fields to group by.
GroupByFields []string `json:"groupByFields,omitempty"`
// The target field to aggregate over when using the sum or max
// aggregations.
// (Deprecated) The target field to aggregate over when using the sum or max
// aggregations. `metrics` field should be used instead.
// Deprecated
Metric *string `json:"metric,omitempty"`
// Group of target fields to aggregate over when using the new value aggregations.
// Group of target fields to aggregate over when using the sum, max, geo data, or new value aggregations. The sum, max, and geo data aggregations only accept one value in this list, whereas the new value aggregation accepts up to five values.
Metrics []string `json:"metrics,omitempty"`
// Name of the query.
Name *string `json:"name,omitempty"`
Expand Down Expand Up @@ -134,6 +135,7 @@ func (o *SecurityMonitoringStandardRuleQuery) SetGroupByFields(v []string) {
}

// GetMetric returns the Metric field value if set, zero value otherwise.
// Deprecated
func (o *SecurityMonitoringStandardRuleQuery) GetMetric() string {
if o == nil || o.Metric == nil {
var ret string
Expand All @@ -144,6 +146,7 @@ func (o *SecurityMonitoringStandardRuleQuery) GetMetric() string {

// GetMetricOk returns a tuple with the Metric field value if set, nil otherwise
// and a boolean to check if the value has been set.
// Deprecated
func (o *SecurityMonitoringStandardRuleQuery) GetMetricOk() (*string, bool) {
if o == nil || o.Metric == nil {
return nil, false
Expand All @@ -157,6 +160,7 @@ func (o *SecurityMonitoringStandardRuleQuery) HasMetric() bool {
}

// SetMetric gets a reference to the given string and assigns it to the Metric field.
// Deprecated
func (o *SecurityMonitoringStandardRuleQuery) SetMetric(v string) {
o.Metric = &v
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-09-27T13:06:48.381Z
2022-10-19T13:36:33.262Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"cases":[{"status":"info"}],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_Bad_Request_response-1664284008","options":{},"queries":[{"query":""}],"tags":[]}
{"cases":[{"status":"info"}],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_Bad_Request_response-1666186593","options":{},"queries":[{"query":""}],"tags":[]}
form: {}
headers:
Accept:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-09-27T13:06:48.898Z
2022-10-19T13:36:33.666Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"cases":[{"condition":"a \u003e 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_OK_response-1664284008","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"log_detection"}
{"cases":[{"condition":"a \u003e 0","name":"","notifications":[],"status":"info"}],"filters":[],"isEnabled":true,"message":"Test rule","name":"Test-Create_a_detection_rule_returns_OK_response-1666186593","options":{"evaluationWindow":900,"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"count","distinctFields":[],"groupByFields":[],"metric":"","query":"@test:true"}],"tags":[],"type":"log_detection"}
form: {}
headers:
Accept:
Expand All @@ -12,8 +12,8 @@ interactions:
url: https://api.datadoghq.com/api/v2/security_monitoring/rules
response:
body: '{"creationAuthorId":1445416,"tags":[],"isEnabled":true,"hasExtendedTitle":false,"message":"Test
rule","options":{"detectionMethod":"threshold","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1664284009174,"filters":[],"queries":[{"query":"@test:true","groupByFields":[],"aggregation":"count","name":"","distinctFields":[]}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":"","condition":"a
> 0"}],"type":"log_detection","id":"dam-cha-bya","isDefault":false,"name":"Test-Create_a_detection_rule_returns_OK_response-1664284008"}
rule","options":{"detectionMethod":"threshold","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1666186594041,"filters":[],"queries":[{"query":"@test:true","groupByFields":[],"aggregation":"count","name":"","distinctFields":[]}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":"","condition":"a
> 0"}],"type":"log_detection","id":"2zr-mrk-aq9","isDefault":false,"name":"Test-Create_a_detection_rule_returns_OK_response-1666186593"}

'
code: 200
Expand All @@ -29,7 +29,7 @@ interactions:
Accept:
- '*/*'
method: DELETE
url: https://api.datadoghq.com/api/v2/security_monitoring/rules/dam-cha-bya
url: https://api.datadoghq.com/api/v2/security_monitoring/rules/2zr-mrk-aq9
response:
body: ''
code: 204
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-09-27T13:06:50.436Z
2022-10-19T13:36:34.442Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"cases":[{"name":"","notifications":[],"status":"info"}],"filters":[],"hasExtendedTitle":true,"isEnabled":true,"message":"test","name":"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1664284010","options":{"detectionMethod":"impossible_travel","evaluationWindow":900,"impossibleTravelOptions":{"baselineUserLocations":false},"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"geo_data","distinctFields":[],"groupByFields":["@usr.id"],"metric":"@network.client.geoip","query":"*"}],"tags":[],"type":"log_detection"}
{"cases":[{"name":"","notifications":[],"status":"info"}],"filters":[],"hasExtendedTitle":true,"isEnabled":true,"message":"test","name":"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1666186594","options":{"detectionMethod":"impossible_travel","evaluationWindow":900,"impossibleTravelOptions":{"baselineUserLocations":false},"keepAlive":3600,"maxSignalDuration":86400},"queries":[{"aggregation":"geo_data","distinctFields":[],"groupByFields":["@usr.id"],"metric":"@network.client.geoip","query":"*"}],"tags":[],"type":"log_detection"}
form: {}
headers:
Accept:
Expand All @@ -11,7 +11,7 @@ interactions:
method: POST
url: https://api.datadoghq.com/api/v2/security_monitoring/rules
response:
body: '{"creationAuthorId":1445416,"tags":[],"isEnabled":true,"hasExtendedTitle":true,"message":"test","options":{"impossibleTravelOptions":{"baselineUserLocations":false},"detectionMethod":"impossible_travel","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1664284010816,"filters":[],"queries":[{"distinctFields":[],"name":"","metric":"@network.client.geoip","aggregation":"geo_data","metrics":["@network.client.geoip"],"groupByFields":["@usr.id"],"query":"*"}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":""}],"type":"log_detection","id":"iat-ydc-4mz","isDefault":false,"name":"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1664284010"}
body: '{"creationAuthorId":1445416,"tags":[],"isEnabled":true,"hasExtendedTitle":true,"message":"test","options":{"impossibleTravelOptions":{"baselineUserLocations":false},"detectionMethod":"impossible_travel","evaluationWindow":900,"maxSignalDuration":86400,"keepAlive":3600},"version":1,"createdAt":1666186594819,"filters":[],"queries":[{"distinctFields":[],"name":"","metric":"@network.client.geoip","aggregation":"geo_data","metrics":["@network.client.geoip"],"groupByFields":["@usr.id"],"query":"*"}],"isDeleted":false,"cases":[{"status":"info","notifications":[],"name":""}],"type":"log_detection","id":"hrr-a7c-wzl","isDefault":false,"name":"Test-Create_a_detection_rule_with_type_impossible_travel_returns_OK_response-1666186594"}

'
code: 200
Expand All @@ -27,7 +27,7 @@ interactions:
Accept:
- '*/*'
method: DELETE
url: https://api.datadoghq.com/api/v2/security_monitoring/rules/iat-ydc-4mz
url: https://api.datadoghq.com/api/v2/security_monitoring/rules/hrr-a7c-wzl
response:
body: ''
code: 204
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2022-09-27T13:06:51.398Z
2022-10-19T13:36:35.608Z
Loading