Monitor

Create a Monitor Resource

new Monitor(name: string, args: MonitorArgs, opts?: CustomResourceOptions);
def Monitor(resource_name, opts=None, enable_logs_sample=None, escalation_message=None, evaluation_delay=None, include_tags=None, locked=None, message=None, name=None, new_host_delay=None, no_data_timeframe=None, notify_audit=None, notify_no_data=None, query=None, renotify_interval=None, require_full_window=None, silenced=None, tags=None, threshold_windows=None, thresholds=None, timeout_h=None, type=None, __props__=None);
func NewMonitor(ctx *Context, name string, args MonitorArgs, opts ...ResourceOption) (*Monitor, error)
public Monitor(string name, MonitorArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args MonitorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MonitorArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MonitorArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

Monitor Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

The Monitor resource accepts the following input properties:

Message string

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

Name string

Name of Datadog monitor

Query string
Type string

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

EnableLogsSample bool

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

EscalationMessage string

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

EvaluationDelay int

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

IncludeTags bool

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

Locked bool

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

NewHostDelay int

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. Defaults to 300.

NoDataTimeframe int

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

NotifyAudit bool

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

NotifyNoData bool

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

RenotifyInterval int

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

RequireFullWindow bool

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

Silenced Dictionary<string, object>

Deprecated: use Downtime Resource instead

Tags List<string>

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

ThresholdWindows MonitorThresholdWindowsArgs

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

Thresholds MonitorThresholdsArgs
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
TimeoutH int

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

Message string

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

Name string

Name of Datadog monitor

Query string
Type string

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

EnableLogsSample bool

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

EscalationMessage string

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

EvaluationDelay int

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

IncludeTags bool

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

Locked bool

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

NewHostDelay int

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. Defaults to 300.

NoDataTimeframe int

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

NotifyAudit bool

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

NotifyNoData bool

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

RenotifyInterval int

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

RequireFullWindow bool

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

Silenced map[string]interface{}

Deprecated: use Downtime Resource instead

Tags []string

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

ThresholdWindows MonitorThresholdWindows

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

Thresholds MonitorThresholds
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
TimeoutH int

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

message string

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

name string

Name of Datadog monitor

query string
type string

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

enableLogsSample boolean

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

escalationMessage string

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

evaluationDelay number

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

includeTags boolean

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

locked boolean

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

newHostDelay number

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. Defaults to 300.

noDataTimeframe number

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

notifyAudit boolean

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

notifyNoData boolean

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

renotifyInterval number

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

requireFullWindow boolean

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

silenced {[key: string]: any}

Deprecated: use Downtime Resource instead

tags string[]

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

thresholdWindows MonitorThresholdWindows

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

thresholds MonitorThresholds
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
timeoutH number

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

message str

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

name str

Name of Datadog monitor

query str
type str

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

enable_logs_sample bool

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

escalation_message str

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

evaluation_delay float

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

include_tags bool

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

locked bool

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

new_host_delay float

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. Defaults to 300.

no_data_timeframe float

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

notify_audit bool

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

notify_no_data bool

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

renotify_interval float

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

require_full_window bool

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

silenced Dict[str, Any]

Deprecated: use Downtime Resource instead

tags List[str]

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

threshold_windows Dict[MonitorThresholdWindows]

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

thresholds Dict[MonitorThresholds]
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
timeout_h float

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

Outputs

All input properties are implicitly available as output properties. Additionally, the Monitor resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing Monitor Resource

Get an existing Monitor resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MonitorState, opts?: CustomResourceOptions): Monitor
static get(resource_name, id, opts=None, enable_logs_sample=None, escalation_message=None, evaluation_delay=None, include_tags=None, locked=None, message=None, name=None, new_host_delay=None, no_data_timeframe=None, notify_audit=None, notify_no_data=None, query=None, renotify_interval=None, require_full_window=None, silenced=None, tags=None, threshold_windows=None, thresholds=None, timeout_h=None, type=None, __props__=None);
func GetMonitor(ctx *Context, name string, id IDInput, state *MonitorState, opts ...ResourceOption) (*Monitor, error)
public static Monitor Get(string name, Input<string> id, MonitorState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

EnableLogsSample bool

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

EscalationMessage string

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

EvaluationDelay int

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

IncludeTags bool

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

Locked bool

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

Message string

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

Name string

Name of Datadog monitor

NewHostDelay int

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. Defaults to 300.

NoDataTimeframe int

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

NotifyAudit bool

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

NotifyNoData bool

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

Query string
RenotifyInterval int

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

RequireFullWindow bool

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

Silenced Dictionary<string, object>

Deprecated: use Downtime Resource instead

Tags List<string>

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

ThresholdWindows MonitorThresholdWindowsArgs

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

Thresholds MonitorThresholdsArgs
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
TimeoutH int

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

Type string

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

EnableLogsSample bool

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

EscalationMessage string

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

EvaluationDelay int

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

IncludeTags bool

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

Locked bool

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

Message string

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

Name string

Name of Datadog monitor

NewHostDelay int

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. Defaults to 300.

NoDataTimeframe int

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

NotifyAudit bool

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

NotifyNoData bool

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

Query string
RenotifyInterval int

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

RequireFullWindow bool

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

Silenced map[string]interface{}

Deprecated: use Downtime Resource instead

Tags []string

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

ThresholdWindows MonitorThresholdWindows

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

Thresholds MonitorThresholds
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
TimeoutH int

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

Type string

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

enableLogsSample boolean

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

escalationMessage string

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

evaluationDelay number

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

includeTags boolean

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

locked boolean

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

message string

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

name string

Name of Datadog monitor

newHostDelay number

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. Defaults to 300.

noDataTimeframe number

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

notifyAudit boolean

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

notifyNoData boolean

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

query string
renotifyInterval number

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

requireFullWindow boolean

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

silenced {[key: string]: any}

Deprecated: use Downtime Resource instead

tags string[]

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

thresholdWindows MonitorThresholdWindows

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

thresholds MonitorThresholds
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
timeoutH number

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

type string

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

enable_logs_sample bool

A boolean indicating whether or not to include a list of log values which triggered the alert. Defaults to false. This is only used by log monitors. triggering tags into the title. Defaults to true.

escalation_message str

A message to include with a re-notification. Supports the ‘@username’ notification allowed elsewhere.

evaluation_delay float

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 will evaluate data from 6:50 to 6:55. This is useful for AWS CloudWatch and other backfilled metrics to ensure the monitor will always have data during evaluation.

include_tags bool

A boolean indicating whether notifications from this monitor automatically insert its triggering tags into the title. Defaults to true.

locked bool

A boolean indicating whether changes to to this monitor should be restricted to the creator or admins. Defaults to False.

message str

A message to include with notifications for this monitor. Email notifications can be sent to specific users by using the same ‘@username’ notation as events.

name str

Name of Datadog monitor

new_host_delay float

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. Defaults to 300.

no_data_timeframe float

The number of minutes before a monitor will notify when data stops reporting. Must be at least 2x the monitor timeframe for metric alerts or 2 minutes for service checks. Default: 2x timeframe for metric alerts, 2 minutes for service checks. Defaults to 10 minutes.

notify_audit bool

A boolean indicating whether tagged users will be notified on changes to this monitor. Defaults to false.

notify_no_data bool

A boolean indicating whether this monitor will notify when data stops reporting. Defaults to false.

query str
renotify_interval float

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

require_full_window bool

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 will be skipped. Default: True for “on average”, “at all times” and “in total” aggregation. False otherwise.

silenced Dict[str, Any]

Deprecated: use Downtime Resource instead

tags List[str]

A list of tags to associate with your monitor. This can help you categorize and filter monitors in the manage monitors page of the UI. Note: it’s not currently possible to filter by these tags when querying via the API

threshold_windows Dict[MonitorThresholdWindows]

A mapping containing recovery_window and trigger_window values, e.g. last_15m. Can only be used for, and are required for, anomaly monitors.

thresholds Dict[MonitorThresholds]
  • Metric alerts: A dictionary of thresholds by threshold type. Currently we have four threshold types for metric alerts: critical, critical recovery, warning, and warning recovery. Critical is defined in the query, but can also be specified in this option. Warning and recovery thresholds can only be specified using the thresholds option. Example usage: thresholds = { critical = 90 critical_recovery = 85 warning = 80 warning_recovery = 75 } Warning: the critical threshold value must match the one contained in the query argument. The threshold from the previous example is valid along with a query like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 90 but along with something like avg(last_1h):avg:system.disk.in_use{role:sqlserver} by {host} > 95 would make the Datadog API return a HTTP error 400, complaining “The value provided for parameter ‘query’ is invalid”.
  • Service checks: A dictionary of thresholds by status. Because service checks can have multiple thresholds, we don’t define them directly in the query. Default values: thresholds = { ok = 1 critical = 1 warning = 1 unknown = 1 }
timeout_h float

The number of hours of the monitor not reporting data before it will automatically resolve from a triggered state. Defaults to false.

type str

The type of the monitor. The mapping from these types to the types found in the Datadog Web UI can be found in the Datadog API documentation page. The available options are below. Note: The monitor type cannot be changed after a monitor is created. * metric alert * service check * event alert * query alert * composite * log alert

Supporting Types

MonitorThresholdWindows

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

RecoveryWindow string

describes how long an anomalous metric must be normal before the alert recovers.

TriggerWindow string

describes how long a metric must be anomalous before an alert triggers.

RecoveryWindow string

describes how long an anomalous metric must be normal before the alert recovers.

TriggerWindow string

describes how long a metric must be anomalous before an alert triggers.

recoveryWindow string

describes how long an anomalous metric must be normal before the alert recovers.

triggerWindow string

describes how long a metric must be anomalous before an alert triggers.

recovery_window str

describes how long an anomalous metric must be normal before the alert recovers.

trigger_window str

describes how long a metric must be anomalous before an alert triggers.

MonitorThresholds

See the input and output API doc for this type.

See the input and output API doc for this type.

See the input and output API doc for this type.

Critical double
CriticalRecovery double
Ok double
Unknown double
Warning double
WarningRecovery double
Critical float64
CriticalRecovery float64
Ok float64
Unknown float64
Warning float64
WarningRecovery float64
critical number
criticalRecovery number
ok number
unknown number
warning number
warningRecovery number
critical float
critical_recovery float
ok float
unknown float
warning float
warning_recovery float

Package Details

Repository
https://github.com/pulumi/pulumi-datadog
License
Apache-2.0
Notes
This Pulumi package is based on the datadog Terraform Provider.