Class: DatadogAPIClient::V1::MonitorOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/datadog_api_client/v1/models/monitor_options.rb

Overview

List of options associated with your monitor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ MonitorOptions

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    attributes Model attributes in the form of hash



188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 188

def initialize(attributes = {})
  if (!attributes.is_a?(Hash))
    fail ArgumentError, "The input argument (attributes) must be a hash in `DatadogAPIClient::V1::MonitorOptions` initialize method"
  end

  # check to see if the attribute exists and convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h|
    if (!self.class.attribute_map.key?(k.to_sym))
      fail ArgumentError, "`#{k}` is not a valid attribute in `DatadogAPIClient::V1::MonitorOptions`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
    end
    h[k.to_sym] = v
  }

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

  if attributes.key?(:'device_ids')
    if (value = attributes[:'device_ids']).is_a?(Array)
      self.device_ids = value
    end
  end

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

  if attributes.key?(:'escalation_message')
    self.escalation_message = attributes[:'escalation_message']
  else
    self.escalation_message = 'none'
  end

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

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

  if attributes.key?(:'include_tags')
    self.include_tags = attributes[:'include_tags']
  else
    self.include_tags = true
  end

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

  if attributes.key?(:'min_failure_duration')
    self.min_failure_duration = attributes[:'min_failure_duration']
  else
    self.min_failure_duration = 0
  end

  if attributes.key?(:'min_location_failed')
    self.min_location_failed = attributes[:'min_location_failed']
  else
    self.min_location_failed = 1
  end

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

  if attributes.key?(:'new_host_delay')
    self.new_host_delay = attributes[:'new_host_delay']
  else
    self.new_host_delay = 300
  end

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

  if attributes.key?(:'notify_audit')
    self.notify_audit = attributes[:'notify_audit']
  else
    self.notify_audit = false
  end

  if attributes.key?(:'notify_no_data')
    self.notify_no_data = attributes[:'notify_no_data']
  else
    self.notify_no_data = false
  end

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

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

  if attributes.key?(:'renotify_statuses')
    if (value = attributes[:'renotify_statuses']).is_a?(Array)
      self.renotify_statuses = value
    end
  end

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

  if attributes.key?(:'silenced')
    if (value = attributes[:'silenced']).is_a?(Hash)
      self.silenced = value
    end
  end

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

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

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

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

  if attributes.key?(:'variables')
    if (value = attributes[:'variables']).is_a?(Array)
      self.variables = value
    end
  end
end

Instance Attribute Details

#aggregationObject

Returns the value of attribute aggregation.



26
27
28
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 26

def aggregation
  @aggregation
end

#device_idsObject

IDs of the device the Synthetics monitor is running on.



29
30
31
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 29

def device_ids
  @device_ids
end

#enable_logs_sampleObject

Whether or not to send a log sample when the log monitor triggers.



32
33
34
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 32

def enable_logs_sample
  @enable_logs_sample
end

#escalation_messageObject

We recommend using the [is_renotify](docs.datadoghq.com/monitors/notify/?tab=is_alert#renotify), block in the original message instead. A message to include with a re-notification. Supports the ‘@username` notification we allow elsewhere. Not applicable if `renotify_interval` is `None`.



35
36
37
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 35

def escalation_message
  @escalation_message
end

#evaluation_delayObject

Time (in seconds) to delay evaluation, as a non-negative integer. For example, if the value is set to ‘300` (5min), the timeframe is set to `last_5m` and the time is 7:00, the monitor evaluates data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor always has data during evaluation.



38
39
40
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 38

def evaluation_delay
  @evaluation_delay
end

#groupby_simple_monitorObject

Whether the log alert monitor triggers a single alert or multiple alerts when any group breaches a threshold.



41
42
43
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 41

def groupby_simple_monitor
  @groupby_simple_monitor
end

#include_tagsObject

A Boolean indicating whether notifications from this monitor automatically inserts its triggering tags into the title. Examples - If ‘True`, `[Triggered on host:h1] Monitor Title` - If `False`, `[Triggered] Monitor Title`



44
45
46
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 44

def include_tags
  @include_tags
end

#lockedObject

Whether or not the monitor is locked (only editable by creator and admins).



47
48
49
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 47

def locked
  @locked
end

#min_failure_durationObject

How long the test should be in failure before alerting (integer, number of seconds, max 7200).



50
51
52
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 50

def min_failure_duration
  @min_failure_duration
end

#min_location_failedObject

The minimum number of locations in failure at the same time during at least one moment in the ‘min_failure_duration` period (`min_location_failed` and `min_failure_duration` are part of the advanced alerting rules - integer, >= 1).



53
54
55
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 53

def min_location_failed
  @min_location_failed
end

#new_group_delayObject

Time (in seconds) to skip evaluations for new groups. For example, this option can be used to skip evaluations for new hosts while they initialize. Must be a non negative integer.



56
57
58
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 56

def new_group_delay
  @new_group_delay
end

#new_host_delayObject

Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non negative integer. Use new_group_delay instead.



59
60
61
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 59

def new_host_delay
  @new_host_delay
end

#no_data_timeframeObject

The number of minutes before a monitor notifies after data stops reporting. Datadog recommends at least 2x the monitor timeframe for query alerts or 2 minutes for service checks. If omitted, 2x the evaluation timeframe is used for query alerts, and 24 hours is used for service checks.



62
63
64
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 62

def no_data_timeframe
  @no_data_timeframe
end

#notify_auditObject

A Boolean indicating whether tagged users is notified on changes to this monitor.



65
66
67
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 65

def notify_audit
  @notify_audit
end

#notify_no_dataObject

A Boolean indicating whether this monitor notifies when data stops reporting.



68
69
70
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 68

def notify_no_data
  @notify_no_data
end

#renotify_intervalObject

The number of minutes after the last notification before a monitor re-notifies on the current status. It only re-notifies if it’s not resolved.



71
72
73
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 71

def renotify_interval
  @renotify_interval
end

#renotify_occurrencesObject

The number of times re-notification messages should be sent on the current status at the provided re-notification interval.



74
75
76
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 74

def renotify_occurrences
  @renotify_occurrences
end

#renotify_statusesObject

The types of monitor statuses for which re-notification messages are sent.



77
78
79
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 77

def renotify_statuses
  @renotify_statuses
end

#require_full_windowObject

A Boolean indicating whether this monitor needs a full window of data before it’s evaluated. We highly recommend you set this to ‘false` for sparse metrics, otherwise some evaluations are skipped. Default is false.



80
81
82
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 80

def require_full_window
  @require_full_window
end

#silencedObject

Information about the downtime applied to the monitor.



83
84
85
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 83

def silenced
  @silenced
end

#synthetics_check_idObject

ID of the corresponding Synthetic check.



86
87
88
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 86

def synthetics_check_id
  @synthetics_check_id
end

#threshold_windowsObject

Returns the value of attribute threshold_windows.



88
89
90
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 88

def threshold_windows
  @threshold_windows
end

#thresholdsObject

Returns the value of attribute thresholds.



90
91
92
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 90

def thresholds
  @thresholds
end

#timeout_hObject

The number of hours of the monitor not reporting data before it automatically resolves from a triggered state. The minimum allowed value is 0 hours. The maximum allowed value is 24 hours.



93
94
95
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 93

def timeout_h
  @timeout_h
end

#variablesObject

List of requests that can be used in the monitor query. **This feature is currently in beta.**



96
97
98
# File 'lib/datadog_api_client/v1/models/monitor_options.rb', line 96

def variables
  @variables
end