Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getMonitor

Use this data source to retrieve information about an existing monitor for use in other resources.

Schema

Optional

  • id (String) The ID of this resource.
  • monitor_tags_filter (List of String) A list of monitor tags to limit the search. This filters on the tags set on the monitor itself.
  • name_filter (String) A monitor name to limit the search.
  • tags_filter (List of String) A list of tags to limit the search. This filters on the monitor scope.

Read-only

  • enable_logs_sample (Boolean) Whether or not a list of log values which triggered the alert is included. This is only used by log monitors.
  • escalation_message (String) Message included with a re-notification for this monitor.
  • evaluation_delay (Number) Time (in seconds) for which evaluation is delayed. This is only used by metric monitors.
  • include_tags (Boolean) Whether or not notifications from the monitor automatically inserts its triggering tags into the title.
  • locked (Boolean) Whether or not changes to the monitor are restricted to the creator or admins.
  • message (String) Message included with notifications for this monitor
  • monitor_threshold_windows (List of Object) Mapping containing recovery_window and trigger_window values, e.g. last_15m. This is only used by anomaly monitors. (see below for nested schema)
  • monitor_thresholds (List of Object) Alert thresholds of the monitor. (see below for nested schema)
  • name (String) Name of the monitor
  • new_host_delay (Number) Time (in seconds) allowing a host to boot and applications to fully start before starting the evaluation of monitor results.
  • no_data_timeframe (Number) The number of minutes before the monitor notifies when data stops reporting.
  • notify_audit (Boolean) Whether or not tagged users are notified on changes to the monitor.
  • notify_no_data (Boolean) Whether or not this monitor notifies when data stops reporting.
  • query (String) Query of the monitor.
  • renotify_interval (Number) The number of minutes after the last notification before the monitor re-notifies on the current status.
  • require_full_window (Boolean) Whether or not the monitor needs a full window of data before it is evaluated.
  • tags (Set of String) List of tags associated with the monitor.
  • threshold_windows (Map of String, Deprecated) Mapping containing recovery_window and trigger_window values, e.g. last_15m. This is only used by anomaly monitors.
  • thresholds (Map of String, Deprecated) Alert thresholds of the monitor.
  • timeout_h (Number) Number of hours of the monitor not reporting data before it automatically resolves from a triggered state.
  • type (String) Type of the monitor.

Nested Schema for monitor_threshold_windows

Read-only:

  • recovery_window (String)
  • trigger_window (String)

Nested Schema for monitor_thresholds

Read-only:

  • critical (String)
  • critical_recovery (String)
  • ok (String)
  • unknown (String)
  • warning (String)
  • warning_recovery (String)

Example Usage

using Pulumi;
using Datadog = Pulumi.Datadog;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(Datadog.GetMonitor.InvokeAsync(new Datadog.GetMonitorArgs
        {
            MonitorTagsFilters = 
            {
                "foo:bar",
            },
            NameFilter = "My awesome monitor",
        }));
    }

}
package main

import (
    "github.com/pulumi/pulumi-datadog/sdk/v2/go/datadog"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := "My awesome monitor"
        _, err := datadog.LookupMonitor(ctx, &datadog.LookupMonitorArgs{
            MonitorTagsFilters: []string{
                "foo:bar",
            },
            NameFilter: &opt0,
        }, nil)
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_datadog as datadog

test = datadog.get_monitor(monitor_tags_filters=["foo:bar"],
    name_filter="My awesome monitor")
import * as pulumi from "@pulumi/pulumi";
import * as datadog from "@pulumi/datadog";

const test = pulumi.output(datadog.getMonitor({
    monitorTagsFilters: ["foo:bar"],
    nameFilter: "My awesome monitor",
}, { async: true }));

Using getMonitor

function getMonitor(args: GetMonitorArgs, opts?: InvokeOptions): Promise<GetMonitorResult>
def get_monitor(monitor_tags_filters: Optional[Sequence[str]] = None, name_filter: Optional[str] = None, tags_filters: Optional[Sequence[str]] = None, opts: Optional[InvokeOptions] = None) -> GetMonitorResult
func LookupMonitor(ctx *Context, args *LookupMonitorArgs, opts ...InvokeOption) (*LookupMonitorResult, error)

Note: This function is named LookupMonitor in the Go SDK.

public static class GetMonitor {
    public static Task<GetMonitorResult> InvokeAsync(GetMonitorArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

MonitorTagsFilters List<string>
NameFilter string
TagsFilters List<string>
monitor_tags_filters Sequence[str]
name_filter str
tags_filters Sequence[str]

getMonitor Result

The following output properties are available:

EnableLogsSample bool
EscalationMessage string
EvaluationDelay int
Id string

The provider-assigned unique ID for this managed resource.

IncludeTags bool
Locked bool
Message string
MonitorThresholdWindows GetMonitorMonitorThresholdWindows
MonitorThresholds GetMonitorMonitorThresholds
Name string
NewHostDelay int
NoDataTimeframe int
NotifyAudit bool
NotifyNoData bool
Query string
RenotifyInterval int
RequireFullWindow bool
Tags List<string>
ThresholdWindows GetMonitorThresholdWindows

Deprecated: Define monitor_threshold_windows list with one element instead.

Thresholds GetMonitorThresholds

Deprecated: Define monitor_thresholds list with one element instead.

TimeoutH int
Type string
MonitorTagsFilters List<string>
NameFilter string
TagsFilters List<string>
EnableLogsSample bool
EscalationMessage string
EvaluationDelay int
Id string

The provider-assigned unique ID for this managed resource.

IncludeTags bool
Locked bool
Message string
MonitorThresholdWindows GetMonitorMonitorThresholdWindows
MonitorThresholds GetMonitorMonitorThresholds
Name string
NewHostDelay int
NoDataTimeframe int
NotifyAudit bool
NotifyNoData bool
Query string
RenotifyInterval int
RequireFullWindow bool
Tags []string
ThresholdWindows GetMonitorThresholdWindows

Deprecated: Define monitor_threshold_windows list with one element instead.

Thresholds GetMonitorThresholds

Deprecated: Define monitor_thresholds list with one element instead.

TimeoutH int
Type string
MonitorTagsFilters []string
NameFilter string
TagsFilters []string
enableLogsSample boolean
escalationMessage string
evaluationDelay number
id string

The provider-assigned unique ID for this managed resource.

includeTags boolean
locked boolean
message string
monitorThresholdWindows GetMonitorMonitorThresholdWindows
monitorThresholds GetMonitorMonitorThresholds
name string
newHostDelay number
noDataTimeframe number
notifyAudit boolean
notifyNoData boolean
query string
renotifyInterval number
requireFullWindow boolean
tags string[]
thresholdWindows GetMonitorThresholdWindows

Deprecated: Define monitor_threshold_windows list with one element instead.

thresholds GetMonitorThresholds

Deprecated: Define monitor_thresholds list with one element instead.

timeoutH number
type string
monitorTagsFilters string[]
nameFilter string
tagsFilters string[]
enable_logs_sample bool
escalation_message str
evaluation_delay int
id str

The provider-assigned unique ID for this managed resource.

include_tags bool
locked bool
message str
monitor_threshold_windows GetMonitorMonitorThresholdWindows
monitor_thresholds GetMonitorMonitorThresholds
name str
new_host_delay int
no_data_timeframe int
notify_audit bool
notify_no_data bool
query str
renotify_interval int
require_full_window bool
tags Sequence[str]
threshold_windows GetMonitorThresholdWindows

Deprecated: Define monitor_threshold_windows list with one element instead.

thresholds GetMonitorThresholds

Deprecated: Define monitor_thresholds list with one element instead.

timeout_h int
type str
monitor_tags_filters Sequence[str]
name_filter str
tags_filters Sequence[str]

Supporting Types

GetMonitorMonitorThresholdWindows

GetMonitorMonitorThresholds

Critical string
CriticalRecovery string
Ok string
Unknown string
Warning string
WarningRecovery string
Critical string
CriticalRecovery string
Ok string
Unknown string
Warning string
WarningRecovery string
critical string
criticalRecovery string
ok string
unknown string
warning string
warningRecovery string

GetMonitorThresholdWindows

GetMonitorThresholds

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

Package Details

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