Skip to content
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: 8 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9034,6 +9034,14 @@ components:
type: array
model_type_override:
$ref: "#/components/schemas/MonitorFormulaAndFunctionDataQualityModelTypeOverride"
sensitivity:
description: |-
Sensitivity of the anomaly detection model, expressed as a multiplier on the width
of the predicted bounds. Higher values widen the bounds and produce fewer alerts;
lower values tighten them and produce more alerts. Defaults to `3.0`.
example: 3.0
format: double
type: number
type: object
MonitorFormulaAndFunctionDataQualityQueryDefinition:
description: A formula and functions data quality query.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2026-07-31T16:36:50.561Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions examples/v1/monitors/CreateMonitor_1532893480.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Create a Data Quality monitor with sensitivity returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V1::MonitorsAPI.new

body = DatadogAPIClient::V1::Monitor.new({
name: "Example-Monitor",
type: DatadogAPIClient::V1::MonitorType::DATA_QUALITY_ALERT,
query: 'formula("query1").last("5m") > 100',
message: "Data quality alert triggered",
tags: [
"test:examplemonitor",
"env:ci",
],
priority: 3,
options: DatadogAPIClient::V1::MonitorOptions.new({
thresholds: DatadogAPIClient::V1::MonitorThresholds.new({
critical: 100,
}),
variables: [
DatadogAPIClient::V1::MonitorFormulaAndFunctionDataQualityQueryDefinition.new({
name: "query1",
data_source: DatadogAPIClient::V1::MonitorFormulaAndFunctionDataQualityDataSource::DATA_QUALITY_METRICS,
measure: "row_count",
filter: "search for column where `database:production AND table:users`",
group_by: [
"entity_id",
],
monitor_options: DatadogAPIClient::V1::MonitorFormulaAndFunctionDataQualityMonitorOptions.new({
sensitivity: 2.5,
}),
}),
],
}),
})
p api_instance.create_monitor(body)
10 changes: 10 additions & 0 deletions features/v1/monitors.feature
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Feature: Monitors
And the response "name" is equal to "{{ unique }}"
And the response "type" is equal to "data-quality alert"

@team:DataDog/monitor-app
Scenario: Create a Data Quality monitor with sensitivity returns "OK" response
Given new "CreateMonitor" request
And body with value {"name": "{{ unique }}", "type": "data-quality alert", "query": "formula(\"query1\").last(\"5m\") > 100", "message": "Data quality alert triggered", "tags": ["test:{{ unique_lower_alnum }}", "env:ci"], "priority": 3, "options": {"thresholds": {"critical": 100}, "variables": [{"name": "query1", "data_source": "data_quality_metrics", "measure": "row_count", "filter": "search for column where `database:production AND table:users`", "group_by": ["entity_id"], "monitor_options": {"sensitivity": 2.5}}]}}
When the request is sent
Then the response status is 200 OK
And the response "name" is equal to "{{ unique }}"
And the response "type" is equal to "data-quality alert"
And the response "options.variables[0].monitor_options.sensitivity" is equal to 2.5

@team:DataDog/monitor-app
Scenario: Create a RUM formula and functions monitor returns "OK" response
Given new "CreateMonitor" request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ class MonitorFormulaAndFunctionDataQualityMonitorOptions
# Override for the model type used in anomaly detection.
attr_accessor :model_type_override

# Sensitivity of the anomaly detection model, expressed as a multiplier on the width
# of the predicted bounds. Higher values widen the bounds and produce fewer alerts;
# lower values tighten them and produce more alerts. Defaults to `3.0`.
attr_accessor :sensitivity

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
Expand All @@ -46,7 +51,8 @@ def self.attribute_map
:'custom_sql' => :'custom_sql',
:'custom_where' => :'custom_where',
:'group_by_columns' => :'group_by_columns',
:'model_type_override' => :'model_type_override'
:'model_type_override' => :'model_type_override',
:'sensitivity' => :'sensitivity'
}
end

Expand All @@ -58,7 +64,8 @@ def self.openapi_types
:'custom_sql' => :'String',
:'custom_where' => :'String',
:'group_by_columns' => :'Array<String>',
:'model_type_override' => :'MonitorFormulaAndFunctionDataQualityModelTypeOverride'
:'model_type_override' => :'MonitorFormulaAndFunctionDataQualityModelTypeOverride',
:'sensitivity' => :'Float'
}
end

Expand Down Expand Up @@ -101,6 +108,10 @@ def initialize(attributes = {})
if attributes.key?(:'model_type_override')
self.model_type_override = attributes[:'model_type_override']
end

if attributes.key?(:'sensitivity')
self.sensitivity = attributes[:'sensitivity']
end
end

# Returns the object in the form of hash, with additionalProperties support.
Expand Down Expand Up @@ -134,14 +145,15 @@ def ==(o)
custom_where == o.custom_where &&
group_by_columns == o.group_by_columns &&
model_type_override == o.model_type_override &&
sensitivity == o.sensitivity &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[crontab_override, custom_sql, custom_where, group_by_columns, model_type_override, additional_properties].hash
[crontab_override, custom_sql, custom_where, group_by_columns, model_type_override, sensitivity, additional_properties].hash
end
end
end
Loading