From b2b67218a8d1f5f9ca7ad3c293e2a625e8909202 Mon Sep 17 00:00:00 2001 From: Hippolyte HENRY Date: Wed, 8 Jul 2020 12:46:30 +0200 Subject: [PATCH 1/6] Add datasource for monitors --- datadog/data_source_datadog_monitor.go | 268 +++++++++++++++++++++++++ datadog/provider.go | 1 + 2 files changed, 269 insertions(+) create mode 100644 datadog/data_source_datadog_monitor.go diff --git a/datadog/data_source_datadog_monitor.go b/datadog/data_source_datadog_monitor.go new file mode 100644 index 000000000..db33f9fa3 --- /dev/null +++ b/datadog/data_source_datadog_monitor.go @@ -0,0 +1,268 @@ +package datadog + +import ( + "fmt" + "log" + "sort" + "strings" + + datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func dataSourceDatadogMonitor() *schema.Resource { + return &schema.Resource{ + Read: dataSourceDatadogMonitorsRead, + + Schema: map[string]*schema.Schema{ + "name_filter": { + Type: schema.TypeString, + Optional: true, + }, + "tags_filter": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "monitor_tags_filter": { + Type: schema.TypeList, + Optional: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + + // Computed values + "name": { + Type: schema.TypeString, + Computed: true, + }, + "message": { + Type: schema.TypeString, + Computed: true, + }, + "escalation_message": { + Type: schema.TypeString, + Computed: true, + }, + "query": { + Type: schema.TypeString, + Computed: true, + }, + "type": { + Type: schema.TypeString, + Computed: true, + }, + + // Options + "thresholds": { + Type: schema.TypeMap, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "ok": { + Type: schema.TypeFloat, + Computed: true, + }, + "warning": { + Type: schema.TypeFloat, + Computed: true, + }, + "critical": { + Type: schema.TypeFloat, + Computed: true, + }, + "unknown": { + Type: schema.TypeFloat, + Computed: true, + }, + "warning_recovery": { + Type: schema.TypeFloat, + Computed: true, + }, + "critical_recovery": { + Type: schema.TypeFloat, + Computed: true, + }, + }, + }, + }, + "threshold_windows": { + Type: schema.TypeMap, + Computed: true, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + "recovery_window": { + Type: schema.TypeString, + Computed: true, + }, + "trigger_window": { + Type: schema.TypeString, + Computed: true, + }, + }, + }, + }, + "notify_no_data": { + Type: schema.TypeBool, + Computed: true, + }, + "new_host_delay": { + Type: schema.TypeInt, + Computed: true, + }, + "evaluation_delay": { + Type: schema.TypeInt, + Computed: true, + }, + "no_data_timeframe": { + Type: schema.TypeInt, + Computed: true, + }, + "renotify_interval": { + Type: schema.TypeInt, + Computed: true, + }, + "notify_audit": { + Type: schema.TypeBool, + Computed: true, + }, + "timeout_h": { + Type: schema.TypeInt, + Computed: true, + }, + "require_full_window": { + Type: schema.TypeBool, + Computed: true, + }, + "locked": { + Type: schema.TypeBool, + Computed: true, + }, + "include_tags": { + Type: schema.TypeBool, + Computed: true, + }, + "tags": { + // we use TypeSet to represent tags, paradoxically to be able to maintain them ordered; + // we order them explicitly in the read/create/update methods of this resource and using + // TypeSet makes Terraform ignore differences in order when creating a plan + Type: schema.TypeSet, + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + "enable_logs_sample": { + Type: schema.TypeBool, + Computed: true, + }, + "force_delete": { + Type: schema.TypeBool, + Computed: true, + }, + }, + } +} + +func dataSourceDatadogMonitorsRead(d *schema.ResourceData, meta interface{}) error { + providerConf := meta.(*ProviderConfiguration) + datadogClientV1 := providerConf.DatadogClientV1 + authV1 := providerConf.AuthV1 + + req := datadogClientV1.MonitorsApi.ListMonitors(authV1) + if v, ok := d.GetOk("name_filter"); ok { + req = req.Name(v.(string)) + } + if v, ok := d.GetOk("tags_filter"); ok { + req = req.Tags(strings.Join(expandStringList(v.([]interface{})), ",")) + } + if v, ok := d.GetOk("monitor_tags_filter"); ok { + req = req.MonitorTags(strings.Join(expandStringList(v.([]interface{})), ",")) + } + + monitors, _, err := req.Execute() + if err != nil { + return translateClientError(err, "error querying monitors") + } + if len(monitors) > 1 { + return fmt.Errorf("your query returned more than one result, please try a more specific search criteria") + } + if len(monitors) == 0 { + return fmt.Errorf("your query returned no result, please try a less specific search criteria") + } + + m := monitors[0] + + thresholds := make(map[string]string) + + if v, ok := m.Options.Thresholds.GetOkOk(); ok { + thresholds["ok"] = fmt.Sprintf("%v", *v) + } + if v, ok := m.Options.Thresholds.GetWarningOk(); ok { + thresholds["warning"] = fmt.Sprintf("%v", *v) + } + if v, ok := m.Options.Thresholds.GetCriticalOk(); ok { + thresholds["critical"] = fmt.Sprintf("%v", *v) + } + if v, ok := m.Options.Thresholds.GetUnknownOk(); ok { + thresholds["unknown"] = fmt.Sprintf("%v", *v) + } + if v, ok := m.Options.Thresholds.GetWarningRecoveryOk(); ok { + thresholds["warning_recovery"] = fmt.Sprintf("%v", *v) + } + if v, ok := m.Options.Thresholds.GetCriticalRecoveryOk(); ok { + thresholds["critical_recovery"] = fmt.Sprintf("%v", *v) + } + + thresholdWindows := make(map[string]string) + for k, v := range map[string]string{ + "recovery_window": m.Options.ThresholdWindows.GetRecoveryWindow(), + "trigger_window": m.Options.ThresholdWindows.GetTriggerWindow(), + } { + if v != "" { + thresholdWindows[k] = v + } + } + + var tags []string + for _, s := range m.GetTags() { + tags = append(tags, s) + } + sort.Strings(tags) + + log.Printf("[DEBUG] monitor: %+v", m) + d.Set("name", m.GetName()) + d.Set("message", m.GetMessage()) + d.Set("query", m.GetQuery()) + d.Set("type", m.GetType()) + + d.Set("thresholds", thresholds) + d.Set("threshold_windows", thresholdWindows) + + d.Set("new_host_delay", m.Options.GetNewHostDelay()) + d.Set("evaluation_delay", m.Options.GetEvaluationDelay()) + d.Set("notify_no_data", m.Options.GetNotifyNoData()) + d.Set("no_data_timeframe", m.Options.NoDataTimeframe) + d.Set("renotify_interval", m.Options.GetRenotifyInterval()) + d.Set("notify_audit", m.Options.GetNotifyAudit()) + d.Set("timeout_h", m.Options.GetTimeoutH()) + d.Set("escalation_message", m.Options.GetEscalationMessage()) + d.Set("include_tags", m.Options.GetIncludeTags()) + d.Set("tags", tags) + d.Set("require_full_window", m.Options.GetRequireFullWindow()) // TODO Is this one of those options that we neeed to check? + d.Set("locked", m.Options.GetLocked()) + + if m.GetType() == datadogV1.MONITORTYPE_LOG_ALERT { + d.Set("enable_logs_sample", m.Options.GetEnableLogsSample()) + } + + return nil +} + +func expandStringList(configured []interface{}) []string { + vs := make([]string, 0, len(configured)) + for _, v := range configured { + val, ok := v.(string) + if ok && val != "" { + vs = append(vs, v.(string)) + } + } + return vs +} diff --git a/datadog/provider.go b/datadog/provider.go index bc309c112..737f5907b 100644 --- a/datadog/provider.go +++ b/datadog/provider.go @@ -74,6 +74,7 @@ func Provider() terraform.ResourceProvider { DataSourcesMap: map[string]*schema.Resource{ "datadog_ip_ranges": dataSourceDatadogIpRanges(), + "datadog_monitor": dataSourceDatadogMonitor(), }, ConfigureFunc: providerConfigure, From b26cbf1eac7131f8b9cef8517835a001dba0ad78 Mon Sep 17 00:00:00 2001 From: Hippolyte HENRY Date: Wed, 8 Jul 2020 13:05:40 +0200 Subject: [PATCH 2/6] Update datadog/data_source_datadog_monitor.go Co-authored-by: Jiri Kuncar --- datadog/data_source_datadog_monitor.go | 1 - 1 file changed, 1 deletion(-) diff --git a/datadog/data_source_datadog_monitor.go b/datadog/data_source_datadog_monitor.go index db33f9fa3..eed522fcf 100644 --- a/datadog/data_source_datadog_monitor.go +++ b/datadog/data_source_datadog_monitor.go @@ -227,7 +227,6 @@ func dataSourceDatadogMonitorsRead(d *schema.ResourceData, meta interface{}) err } sort.Strings(tags) - log.Printf("[DEBUG] monitor: %+v", m) d.Set("name", m.GetName()) d.Set("message", m.GetMessage()) d.Set("query", m.GetQuery()) From 177004762beb35371e475cf343feb931a96d63b4 Mon Sep 17 00:00:00 2001 From: Hippolyte HENRY Date: Thu, 9 Jul 2020 11:17:44 +0200 Subject: [PATCH 3/6] Set monitor id in data source --- datadog/data_source_datadog_monitor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/datadog/data_source_datadog_monitor.go b/datadog/data_source_datadog_monitor.go index eed522fcf..89e95c42d 100644 --- a/datadog/data_source_datadog_monitor.go +++ b/datadog/data_source_datadog_monitor.go @@ -2,8 +2,8 @@ package datadog import ( "fmt" - "log" "sort" + "strconv" "strings" datadogV1 "github.com/DataDog/datadog-api-client-go/api/v1/datadog" @@ -227,6 +227,7 @@ func dataSourceDatadogMonitorsRead(d *schema.ResourceData, meta interface{}) err } sort.Strings(tags) + d.SetId(strconv.FormatInt(m.GetId(), 10)) d.Set("name", m.GetName()) d.Set("message", m.GetMessage()) d.Set("query", m.GetQuery()) From b8c168a86899dcee324ede2925ed4349b294950f Mon Sep 17 00:00:00 2001 From: Hippolyte HENRY Date: Thu, 9 Jul 2020 13:18:15 +0200 Subject: [PATCH 4/6] Add test for monitor datasource --- datadog/data_source_datadog_monitor_test.go | 152 ++++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 datadog/data_source_datadog_monitor_test.go diff --git a/datadog/data_source_datadog_monitor_test.go b/datadog/data_source_datadog_monitor_test.go new file mode 100644 index 000000000..dbdc33f74 --- /dev/null +++ b/datadog/data_source_datadog_monitor_test.go @@ -0,0 +1,152 @@ +package datadog + +import ( + "fmt" + "testing" + "time" + + "github.com/hashicorp/terraform-plugin-sdk/helper/resource" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +func TestAccDatadogMonitorDatasource(t *testing.T) { + accProviders, cleanup := testAccProviders(t, initRecorder(t)) + defer cleanup(t) + accProvider := testAccProvider(t, accProviders) + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: accProviders, + CheckDestroy: testAccCheckDatadogMonitorDestroy(accProvider), + Steps: []resource.TestStep{ + { + Config: testAccDatasourceMonitorNameFilterConfig, + // Because of the `depends_on` in the datasource, the plan cannot be empty. + // See https://www.terraform.io/docs/configuration/data-sources.html#data-resource-dependencies + ExpectNonEmptyPlan: true, + Check: checkDatasourceAttrs(accProvider), + }, + { + Config: testAccDatasourceMonitorTagsFilterConfig, + // Because of the `depends_on` in the datasource, the plan cannot be empty. + // See https://www.terraform.io/docs/configuration/data-sources.html#data-resource-dependencies + ExpectNonEmptyPlan: true, + Check: checkDatasourceAttrs(accProvider), + }, + { + Config: testAccDatasourceMonitorMonitorTagsFilterConfig, + // Because of the `depends_on` in the datasource, the plan cannot be empty. + // See https://www.terraform.io/docs/configuration/data-sources.html#data-resource-dependencies + ExpectNonEmptyPlan: true, + Check: checkDatasourceAttrs(accProvider), + }, + }, + }) +} + +func checkDatasourceAttrs(accProvider *schema.Provider) resource.TestCheckFunc { + return resource.ComposeTestCheckFunc( + testAccCheckDatadogMonitorExists(accProvider, "datadog_monitor.foo"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "name", fmt.Sprintf("monitor for datasource %d", now)), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "message", "some message Notify: @hipchat-channel"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "type", "query alert"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "query", fmt.Sprintf("avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:%d} by {host} > 2", now)), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "notify_no_data", "false"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "new_host_delay", "600"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "evaluation_delay", "700"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "renotify_interval", "60"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "thresholds.warning", "1"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "thresholds.warning_recovery", "0.5"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "thresholds.critical", "2"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "thresholds.critical_recovery", "1.5"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "require_full_window", "true"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "locked", "false"), + // Tags are a TypeSet => use a weird way to access members by their hash + // TF TypeSet is internally represented as a map that maps computed hashes + // to actual values. Since the hashes are always the same for one value, + // this is the way to get them. + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "tags.#", "2"), + resource.TestCheckResourceAttr( + "data.datadog_monitor.foo", "tags.2644851163", "baz"), + ) +} + +var now = time.Now().Unix() + +var testAccMonitorConfig = fmt.Sprintf(` +resource "datadog_monitor" "foo" { + name = "monitor for datasource %d" + type = "query alert" + message = "some message Notify: @hipchat-channel" + escalation_message = "the situation has escalated @pagerduty" + + query = "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:%d} by {host} > 2" + + thresholds = { + warning = "1.0" + critical = "2.0" + warning_recovery = "0.5" + critical_recovery = "1.5" + } + + renotify_interval = 60 + + notify_audit = false + timeout_h = 60 + new_host_delay = 600 + evaluation_delay = 700 + include_tags = true + require_full_window = true + locked = false + tags = ["test_datasource_monitor:%d", "baz"] +} +`, now, now, now) + +var testAccDatasourceMonitorNameFilterConfig = fmt.Sprintf(` +%s +data "datadog_monitor" "foo" { + depends_on = [ + datadog_monitor.foo, + ] + name_filter = "monitor for datasource %d" +} +`, testAccMonitorConfig, now) + +var testAccDatasourceMonitorTagsFilterConfig = fmt.Sprintf(` +%s +data "datadog_monitor" "foo" { + depends_on = [ + datadog_monitor.foo, + ] + tags_filter = [ + "test_datasource_monitor_scope:%d", + ] +} +`, testAccMonitorConfig, now) + +var testAccDatasourceMonitorMonitorTagsFilterConfig = fmt.Sprintf(` +%s +data "datadog_monitor" "foo" { + depends_on = [ + datadog_monitor.foo, + ] + monitor_tags_filter = [ + "test_datasource_monitor:%d", + ] +} +`, testAccMonitorConfig, now) From efafc048411255bac41bfb58b5d12ee3f3710f69 Mon Sep 17 00:00:00 2001 From: Hippolyte HENRY Date: Thu, 9 Jul 2020 17:07:44 +0200 Subject: [PATCH 5/6] Add cassette --- .../TestAccDatadogMonitorDatasource.yaml | 1438 +++++++++++++++++ 1 file changed, 1438 insertions(+) create mode 100644 datadog/cassettes/TestAccDatadogMonitorDatasource.yaml diff --git a/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml b/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml new file mode 100644 index 000000000..8b6ab0545 --- /dev/null +++ b/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml @@ -0,0 +1,1438 @@ +--- +version: 1 +interactions: +- request: + body: | + {"message":"some message Notify: @hipchat-channel","name":"monitor for datasource 1594307245","options":{"escalation_message":"the situation has escalated @pagerduty","evaluation_delay":700,"include_tags":true,"new_host_delay":600,"notify_no_data":false,"renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"critical_recovery":1.5,"warning":1,"warning_recovery":0.5},"timeout_h":60},"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} by {host} \u003e 2","tags":["baz","test_datasource_monitor:1594307245"],"type":"query alert"} + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + Dd-Operation-Id: + - CreateMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor + method: POST + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:26 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:26 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - Wn01ZjXucAfzJfwvKAkpy0yFfNtHyWu4ZB2aA4ZDwwhXkyLHirYeUNsx208dZz9p + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "500" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "499" + X-Ratelimit-Reset: + - "4" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:26 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:26 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - UlUHD7I7ISIp2OTIKJ1HGCksOU1snpAx2HtkPJw2SYzWMPmqzICEuimWl9Uiyokg + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2999" + X-Ratelimit-Reset: + - "4" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListMonitors + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor?name=monitor+for+datasource+1594307245 + method: GET + response: + body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Thu, 09 Jul 2020 15:07:26 GMT + Dd-Pool: + - dogweb + Etag: + - W/"d3e4f953ab4484b32a59755d9e70af93" + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:26 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - x4pYHtiOW9rUeREgXmH2iIgBaXVGD7x1RIZUg56H0ghPppdtz0ZBEK6nMs8tuoqc + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "1000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "999" + X-Ratelimit-Reset: + - "4" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:27 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - sAPKocoLMDEnM5qY2PL6SCQ+dkENYAR/6IistAQ5iiTU/UnJHAba158nxOvVRvKJ + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2998" + X-Ratelimit-Reset: + - "3" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:27 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - rpB/2GMZHvzTHZxhwmnNa1XnSQuif7FV+gIndoDc8IvUeRNb65r4x+P7Djp1119C + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2997" + X-Ratelimit-Reset: + - "3" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:27 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - eORbNuNjI+uNwQ5fL4WiSFLQTO+rx/Fd8RRk0TnSyEY4gQIkjrXIuJ1XAoOa+8yj + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2996" + X-Ratelimit-Reset: + - "3" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:27 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - e/PzE6y8JJ1tlF66uEI2h0RElcpoaXRe9TzYMeQVIADcqTHrHUqcUgRemfbYKGMv + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2995" + X-Ratelimit-Reset: + - "3" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:27 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - JEThRmJp6qTNp8pxXQqPpRD40l23OvSASz6GutTWG+aCw+n9cF/5KqfPSziGHWsU + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2994" + X-Ratelimit-Reset: + - "3" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:27 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - iMTE1BmjsL8tFxXfV1x35HHEpphKhyShj7mGG+gCh4hVOBaK9+R0wmURPHnATwmw + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2993" + X-Ratelimit-Reset: + - "3" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListMonitors + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor?tags=test_datasource_monitor_scope%3A1594307245 + method: GET + response: + body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Thu, 09 Jul 2020 15:07:28 GMT + Dd-Pool: + - dogweb + Etag: + - W/"d3e4f953ab4484b32a59755d9e70af93" + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - eORbNuNjI+uNwQ5fL4WiSFLQTO+rx/Fd8RRk0TnSyEY4gQIkjrXIuJ1XAoOa+8yj + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "1000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "998" + X-Ratelimit-Reset: + - "2" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:28 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - vQYgH+orCqhRbQG/mSd6IeQSqyYBCkFVCv4Bj6PXMALQcvTK5EvxQuH7fIz3d52m + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2992" + X-Ratelimit-Reset: + - "2" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:28 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - vQYgH+orCqhRbQG/mSd6IeQSqyYBCkFVCv4Bj6PXMALQcvTK5EvxQuH7fIz3d52m + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2991" + X-Ratelimit-Reset: + - "2" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:28 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - 4HTfT92VNwJOKM3+9Fghpi7RnKwXOMM9XiE8bZkwhVPDb5jbW4knJKZPCpE1XUb8 + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2990" + X-Ratelimit-Reset: + - "2" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:28 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - J7vOWsxZd7Grxzg2TIaQpn2nGjrOScgI4Kwzur8V2oOTYInX6xbVT4leinNkGLPk + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2989" + X-Ratelimit-Reset: + - "2" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:28 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - EbXB0e7cF4uDRViRvI+w6qPg1YzykoJqZiw5SbqL/81VRQW4a286h09eTGyIVvXJ + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2988" + X-Ratelimit-Reset: + - "2" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:29 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - em3KoJu1XYdqq1w4EpLi4L54svjYBxZahEDJ8c5gcdIOxnNafHMdF5LLysPLuNcH + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2987" + X-Ratelimit-Reset: + - "1" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - ListMonitors + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor?monitor_tags=test_datasource_monitor%3A1594307245 + method: GET + response: + body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}]' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Thu, 09 Jul 2020 15:07:29 GMT + Dd-Pool: + - dogweb + Etag: + - W/"d3e4f953ab4484b32a59755d9e70af93" + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - QgRGXxkxV9A4PZPYRoesCGgupw+m7xaD1r9nbJHgAaPeprYV0FnzI0EYYO7x6f4+ + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "1000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "997" + X-Ratelimit-Reset: + - "1" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:29 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - A5a5htKhTUF1FdBQZRUZl4RVawKwk2RUtaZz3EDBmdXc0X6i0O7TBEBWn4bIBQ01 + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2986" + X-Ratelimit-Reset: + - "1" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:29 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - XrVF9iGOfdATIczLJsCTqr1ORVJWAydZm12oLZRyDN+lGe5bU8VekbcSMjJ2fj90 + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2985" + X-Ratelimit-Reset: + - "1" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:30 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - Iy6HNgrdx6jplabT1ZfQVzkCrk+jqjHEQw0NvfR/5Sb/NsvSUgBv2AbCahJdaB7p + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2999" + X-Ratelimit-Reset: + - "10" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:30 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - HTCsbjwqQM0jTFHFq9ukWObBv4f/yxvHIxzrANPhzJkr6s3+rN5uCN3TcZuK2V2B + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2998" + X-Ratelimit-Reset: + - "10" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:30 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - jety+2H6BA1H4x31+wzy5BjqI2NDwh54fgbjSYyrLU0p2tWQPCCTKspX7sHO7u1n + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2997" + X-Ratelimit-Reset: + - "10" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - GetMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor + for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the + situation has escalated @pagerduty"}}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:30 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - KHJbOoqp3I4BOBzIFnc/Ois3eg3Rjmudy0YalRpnXQEDXDoppykpDMDaJPIufi9t + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2996" + X-Ratelimit-Reset: + - "10" + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Dd-Operation-Id: + - DeleteMonitor + User-Agent: + - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: DELETE + response: + body: '{"deleted_monitor_id":20050519}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json; charset=utf-8 + Date: + - Thu, 09 Jul 2020 15:07:30 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Set-Cookie: + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + secure; HttpOnly + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Debug: + - og1WGdy+2nV+rkkclmd3Cf2I26XhV3/6yjBeQCP8aHbH2k2cKwC+X9WmhIghcJ94 + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + User-Agent: + - Datadog/dev/terraform (go1.14.1) + url: https://api.datadoghq.com/api/v1/monitor/20050519 + method: GET + response: + body: '{"errors":["Monitor not found"]}' + headers: + Cache-Control: + - no-cache + Connection: + - keep-alive + Content-Security-Policy: + - frame-ancestors 'self'; report-uri https://api.datadoghq.com/csp-report + Content-Type: + - application/json + Date: + - Thu, 09 Jul 2020 15:07:31 GMT + Dd-Pool: + - dogweb + Pragma: + - no-cache + Strict-Transport-Security: + - max-age=15724800; + Vary: + - Accept-Encoding + X-Content-Type-Options: + - nosniff + X-Dd-Version: + - "35.2720045" + X-Frame-Options: + - SAMEORIGIN + X-Ratelimit-Limit: + - "3000" + X-Ratelimit-Period: + - "10" + X-Ratelimit-Remaining: + - "2995" + X-Ratelimit-Reset: + - "10" + status: 404 Not Found + code: 404 + duration: "" From b23cc24c32fae8a2ce93511a8f7e9265b0656fd4 Mon Sep 17 00:00:00 2001 From: Hippolyte HENRY Date: Thu, 9 Jul 2020 17:22:29 +0200 Subject: [PATCH 6/6] remove time --- .../TestAccDatadogMonitorDatasource.yaml | 432 +++++++++--------- datadog/data_source_datadog_monitor_test.go | 29 +- 2 files changed, 229 insertions(+), 232 deletions(-) diff --git a/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml b/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml index 8b6ab0545..5117af3ee 100644 --- a/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml +++ b/datadog/cassettes/TestAccDatadogMonitorDatasource.yaml @@ -3,7 +3,7 @@ version: 1 interactions: - request: body: | - {"message":"some message Notify: @hipchat-channel","name":"monitor for datasource 1594307245","options":{"escalation_message":"the situation has escalated @pagerduty","evaluation_delay":700,"include_tags":true,"new_host_delay":600,"notify_no_data":false,"renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"critical_recovery":1.5,"warning":1,"warning_recovery":0.5},"timeout_h":60},"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} by {host} \u003e 2","tags":["baz","test_datasource_monitor:1594307245"],"type":"query alert"} + {"message":"some message Notify: @hipchat-channel","name":"monitor for datasource test","options":{"escalation_message":"the situation has escalated @pagerduty","evaluation_delay":700,"include_tags":true,"new_host_delay":600,"notify_no_data":false,"renotify_interval":60,"require_full_window":true,"thresholds":{"critical":2,"critical_recovery":1.5,"warning":1,"warning_recovery":0.5},"timeout_h":60},"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} by {host} \u003e 2","tags":["baz","test_datasource_monitor:foo"],"type":"query alert"} form: {} headers: Accept: @@ -17,9 +17,9 @@ interactions: url: https://api.datadoghq.com/api/v1/monitor method: POST response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -32,13 +32,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:26 GMT + - Thu, 09 Jul 2020 15:22:49 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:26 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:49 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -47,7 +47,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - Wn01ZjXucAfzJfwvKAkpy0yFfNtHyWu4ZB2aA4ZDwwhXkyLHirYeUNsx208dZz9p + - e8t0cvW5uVKXk1zUsTcAcDpqv28dgy+lCs/R2sCfbKW6stomFiq2a4ijzxRdPBn5 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -59,7 +59,7 @@ interactions: X-Ratelimit-Remaining: - "499" X-Ratelimit-Reset: - - "4" + - "1" status: 200 OK code: 200 duration: "" @@ -73,12 +73,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -91,13 +91,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:26 GMT + - Thu, 09 Jul 2020 15:22:49 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:26 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:49 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -106,7 +106,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - UlUHD7I7ISIp2OTIKJ1HGCksOU1snpAx2HtkPJw2SYzWMPmqzICEuimWl9Uiyokg + - xNK8D8E4U1PyLMVOdDgzcc4izX6UzMbP9Ygv1jJl/dgpKsJQ0NHsqPPadJ+IsqEV X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -118,7 +118,7 @@ interactions: X-Ratelimit-Remaining: - "2999" X-Ratelimit-Reset: - - "4" + - "1" status: 200 OK code: 200 duration: "" @@ -132,12 +132,12 @@ interactions: - ListMonitors User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor?name=monitor+for+datasource+1594307245 + url: https://api.datadoghq.com/api/v1/monitor?name=monitor+for+datasource+test method: GET response: - body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}]' headers: @@ -150,15 +150,15 @@ interactions: Content-Type: - application/json Date: - - Thu, 09 Jul 2020 15:07:26 GMT + - Thu, 09 Jul 2020 15:22:50 GMT Dd-Pool: - dogweb Etag: - - W/"d3e4f953ab4484b32a59755d9e70af93" + - W/"2ebfaf1f802947083441663893b742f7" Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:26 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:49 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -167,7 +167,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - x4pYHtiOW9rUeREgXmH2iIgBaXVGD7x1RIZUg56H0ghPppdtz0ZBEK6nMs8tuoqc + - cYNsy3QDuOaYo2clO/PharSNtCykS9KtUfiNevH3xDbHJlRyddWkNpuDhMgHWZ43 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -179,7 +179,7 @@ interactions: X-Ratelimit-Remaining: - "999" X-Ratelimit-Reset: - - "4" + - "1" status: 200 OK code: 200 duration: "" @@ -189,12 +189,12 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -207,13 +207,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:27 GMT + - Thu, 09 Jul 2020 15:22:50 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:50 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -222,7 +222,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - sAPKocoLMDEnM5qY2PL6SCQ+dkENYAR/6IistAQ5iiTU/UnJHAba158nxOvVRvKJ + - gH++OYwf8a2QZXnzDsHHnXqPhHbI48oqNvFjE/0p0ObpMBY4290QCI5SB0tU0MAF X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -232,9 +232,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2998" + - "2999" X-Ratelimit-Reset: - - "3" + - "10" status: 200 OK code: 200 duration: "" @@ -244,12 +244,12 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -262,13 +262,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:27 GMT + - Thu, 09 Jul 2020 15:22:50 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:50 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -277,7 +277,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - rpB/2GMZHvzTHZxhwmnNa1XnSQuif7FV+gIndoDc8IvUeRNb65r4x+P7Djp1119C + - YKF8+1vTI0wiWlB3VWhiMVnZ1RLtV3h2yAW6/TGe9qIMWdYXxsNpy3J4QxfrJoDD X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -287,9 +287,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2997" + - "2998" X-Ratelimit-Reset: - - "3" + - "10" status: 200 OK code: 200 duration: "" @@ -303,12 +303,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -321,13 +321,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:27 GMT + - Thu, 09 Jul 2020 15:22:50 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:50 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -336,7 +336,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - eORbNuNjI+uNwQ5fL4WiSFLQTO+rx/Fd8RRk0TnSyEY4gQIkjrXIuJ1XAoOa+8yj + - sAPKocoLMDEnM5qY2PL6SCQ+dkENYAR/6IistAQ5iiTU/UnJHAba158nxOvVRvKJ X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -346,9 +346,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2996" + - "2997" X-Ratelimit-Reset: - - "3" + - "10" status: 200 OK code: 200 duration: "" @@ -362,12 +362,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -380,13 +380,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:27 GMT + - Thu, 09 Jul 2020 15:22:50 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:50 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -395,7 +395,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - e/PzE6y8JJ1tlF66uEI2h0RElcpoaXRe9TzYMeQVIADcqTHrHUqcUgRemfbYKGMv + - AVsav2jjRGvwjNvJeRUS7kJsgTlhh9y9smyL3UJVQTMAUoPyejdL0bVSnanIQLK4 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -405,9 +405,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2995" + - "2996" X-Ratelimit-Reset: - - "3" + - "10" status: 200 OK code: 200 duration: "" @@ -421,12 +421,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -439,13 +439,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:27 GMT + - Thu, 09 Jul 2020 15:22:50 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:50 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -454,7 +454,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - JEThRmJp6qTNp8pxXQqPpRD40l23OvSASz6GutTWG+aCw+n9cF/5KqfPSziGHWsU + - HIunaScoW4AWw8tnSbk8zc5V6c9XLV6++/KbgzaC4HIb212+evjUYL1yRLeLtS2T X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -464,9 +464,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2994" + - "2995" X-Ratelimit-Reset: - - "3" + - "10" status: 200 OK code: 200 duration: "" @@ -480,12 +480,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -498,13 +498,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:27 GMT + - Thu, 09 Jul 2020 15:22:51 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:50 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -513,7 +513,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - iMTE1BmjsL8tFxXfV1x35HHEpphKhyShj7mGG+gCh4hVOBaK9+R0wmURPHnATwmw + - +0e88dcOoH2a7qrZ5zz4PnubdrAKvSl+k8YKr4bhBQyArPBFiYg3oXWqeVKLPB1I X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -523,9 +523,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2993" + - "2994" X-Ratelimit-Reset: - - "3" + - "10" status: 200 OK code: 200 duration: "" @@ -539,12 +539,12 @@ interactions: - ListMonitors User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor?tags=test_datasource_monitor_scope%3A1594307245 + url: https://api.datadoghq.com/api/v1/monitor?tags=test_datasource_monitor_scope%3Afoo method: GET response: - body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}]' headers: @@ -557,15 +557,15 @@ interactions: Content-Type: - application/json Date: - - Thu, 09 Jul 2020 15:07:28 GMT + - Thu, 09 Jul 2020 15:22:51 GMT Dd-Pool: - dogweb Etag: - - W/"d3e4f953ab4484b32a59755d9e70af93" + - W/"2ebfaf1f802947083441663893b742f7" Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:27 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:51 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -574,7 +574,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - eORbNuNjI+uNwQ5fL4WiSFLQTO+rx/Fd8RRk0TnSyEY4gQIkjrXIuJ1XAoOa+8yj + - o1rjyOSbDnvYaQgtO33vwWSNsIwHafzLqam2amG/PbTP69SVY965ZpWutdoYJB30 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -584,9 +584,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "998" + - "999" X-Ratelimit-Reset: - - "2" + - "9" status: 200 OK code: 200 duration: "" @@ -596,12 +596,12 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -614,13 +614,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:28 GMT + - Thu, 09 Jul 2020 15:22:51 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:51 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -629,7 +629,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - vQYgH+orCqhRbQG/mSd6IeQSqyYBCkFVCv4Bj6PXMALQcvTK5EvxQuH7fIz3d52m + - UmZMvwWLI5lgbGFBnw6J7jqO5hwyrvVF8Un8TwZ8TRQQ6jetE/6GVTSaoSUmQWRg X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -639,9 +639,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2992" + - "2993" X-Ratelimit-Reset: - - "2" + - "9" status: 200 OK code: 200 duration: "" @@ -651,12 +651,12 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -669,13 +669,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:28 GMT + - Thu, 09 Jul 2020 15:22:51 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:51 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -684,7 +684,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - vQYgH+orCqhRbQG/mSd6IeQSqyYBCkFVCv4Bj6PXMALQcvTK5EvxQuH7fIz3d52m + - tp1qdVxoUmtlsVp6hgBWraWfL5vEbA116VZkaWKWIZtgPr5Ima8zysCBv+o2WoZ/ X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -694,9 +694,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2991" + - "2992" X-Ratelimit-Reset: - - "2" + - "9" status: 200 OK code: 200 duration: "" @@ -710,12 +710,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -728,13 +728,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:28 GMT + - Thu, 09 Jul 2020 15:22:51 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:51 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -743,7 +743,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - 4HTfT92VNwJOKM3+9Fghpi7RnKwXOMM9XiE8bZkwhVPDb5jbW4knJKZPCpE1XUb8 + - UlUHD7I7ISIp2OTIKJ1HGCksOU1snpAx2HtkPJw2SYzWMPmqzICEuimWl9Uiyokg X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -753,9 +753,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2990" + - "2991" X-Ratelimit-Reset: - - "2" + - "9" status: 200 OK code: 200 duration: "" @@ -769,12 +769,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -787,13 +787,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:28 GMT + - Thu, 09 Jul 2020 15:22:52 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -802,7 +802,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - J7vOWsxZd7Grxzg2TIaQpn2nGjrOScgI4Kwzur8V2oOTYInX6xbVT4leinNkGLPk + - 4HTfT92VNwJOKM3+9Fghpi7RnKwXOMM9XiE8bZkwhVPDb5jbW4knJKZPCpE1XUb8 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -812,9 +812,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2989" + - "2990" X-Ratelimit-Reset: - - "2" + - "8" status: 200 OK code: 200 duration: "" @@ -828,12 +828,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -846,13 +846,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:28 GMT + - Thu, 09 Jul 2020 15:22:52 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:28 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -861,7 +861,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - EbXB0e7cF4uDRViRvI+w6qPg1YzykoJqZiw5SbqL/81VRQW4a286h09eTGyIVvXJ + - IRAJ1mQ+c3epm0CLGtZoe/y8O4TCss3jYw+fwQOm7+eSKRCE+p3OtawVnIQ5ts76 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -871,9 +871,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2988" + - "2989" X-Ratelimit-Reset: - - "2" + - "8" status: 200 OK code: 200 duration: "" @@ -887,12 +887,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -905,13 +905,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:29 GMT + - Thu, 09 Jul 2020 15:22:52 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -920,7 +920,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - em3KoJu1XYdqq1w4EpLi4L54svjYBxZahEDJ8c5gcdIOxnNafHMdF5LLysPLuNcH + - i90G6k4M6qI4UypyvMoczcO5m+jatiEQSMeHpdjycp0h4nWxRpKUHr6efynkbQs+ X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -930,9 +930,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2987" + - "2988" X-Ratelimit-Reset: - - "1" + - "8" status: 200 OK code: 200 duration: "" @@ -946,12 +946,12 @@ interactions: - ListMonitors User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor?monitor_tags=test_datasource_monitor%3A1594307245 + url: https://api.datadoghq.com/api/v1/monitor?monitor_tags=test_datasource_monitor%3Afoo method: GET response: - body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '[{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","matching_downtimes":[{"end":null,"monitor_id":null,"start":1594155777,"groups":[],"active":true,"scope":["*"],"id":884380028},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380035},{"end":null,"monitor_id":null,"start":1594155778,"groups":[],"active":true,"scope":["*"],"id":884380042},{"end":null,"monitor_id":null,"start":1594156034,"groups":[],"active":true,"scope":["*"],"id":884383075}],"id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}]' headers: @@ -964,15 +964,15 @@ interactions: Content-Type: - application/json Date: - - Thu, 09 Jul 2020 15:07:29 GMT + - Thu, 09 Jul 2020 15:22:52 GMT Dd-Pool: - dogweb Etag: - - W/"d3e4f953ab4484b32a59755d9e70af93" + - W/"2ebfaf1f802947083441663893b742f7" Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -981,7 +981,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - QgRGXxkxV9A4PZPYRoesCGgupw+m7xaD1r9nbJHgAaPeprYV0FnzI0EYYO7x6f4+ + - 7vC9CD2UnUYbC7cu05B95RgDyGt2vcRq8GQJgBahx4BAPKzA8OvLqEF8NdaLccla X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -991,9 +991,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "997" + - "998" X-Ratelimit-Reset: - - "1" + - "8" status: 200 OK code: 200 duration: "" @@ -1003,12 +1003,12 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -1021,13 +1021,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:29 GMT + - Thu, 09 Jul 2020 15:22:52 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1036,7 +1036,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - A5a5htKhTUF1FdBQZRUZl4RVawKwk2RUtaZz3EDBmdXc0X6i0O7TBEBWn4bIBQ01 + - IRAJ1mQ+c3epm0CLGtZoe/y8O4TCss3jYw+fwQOm7+eSKRCE+p3OtawVnIQ5ts76 X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1046,9 +1046,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2986" + - "2987" X-Ratelimit-Reset: - - "1" + - "8" status: 200 OK code: 200 duration: "" @@ -1058,12 +1058,12 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -1076,13 +1076,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:29 GMT + - Thu, 09 Jul 2020 15:22:52 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:29 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:52 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1091,7 +1091,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - XrVF9iGOfdATIczLJsCTqr1ORVJWAydZm12oLZRyDN+lGe5bU8VekbcSMjJ2fj90 + - RL7BSOiWXeq2P2iJbmiDo/2BPpcpoCDzQceVuBkp6yO348trcqTrfm/pm8rvZRoT X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1101,9 +1101,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2985" + - "2986" X-Ratelimit-Reset: - - "1" + - "8" status: 200 OK code: 200 duration: "" @@ -1117,12 +1117,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -1135,13 +1135,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:30 GMT + - Thu, 09 Jul 2020 15:22:53 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1150,7 +1150,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - Iy6HNgrdx6jplabT1ZfQVzkCrk+jqjHEQw0NvfR/5Sb/NsvSUgBv2AbCahJdaB7p + - GAK1J4mJd/EBZfEK4rqUw9OeB9GOeKgSyrXGtzNUi5zrv5sHYU56xJgA4bcbtgUA X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1160,9 +1160,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2999" + - "2985" X-Ratelimit-Reset: - - "10" + - "7" status: 200 OK code: 200 duration: "" @@ -1176,12 +1176,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -1194,13 +1194,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:30 GMT + - Thu, 09 Jul 2020 15:22:53 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1209,7 +1209,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - HTCsbjwqQM0jTFHFq9ukWObBv4f/yxvHIxzrANPhzJkr6s3+rN5uCN3TcZuK2V2B + - btzHvL7Rg/f/n1wMP2CFVXsuErrwOO9p2hvsBofLQbxzRkmZbfvXcB18pURNtIOI X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1219,9 +1219,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2998" + - "2984" X-Ratelimit-Reset: - - "10" + - "7" status: 200 OK code: 200 duration: "" @@ -1235,12 +1235,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -1253,13 +1253,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:30 GMT + - Thu, 09 Jul 2020 15:22:53 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1268,7 +1268,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - jety+2H6BA1H4x31+wzy5BjqI2NDwh54fgbjSYyrLU0p2tWQPCCTKspX7sHO7u1n + - DNJM9d0LaQZJbuEjasKEmgCwDoiLnJW9mPQJm+yWIlQRbFhX4Vzx4uuDCt38dWhb X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1278,9 +1278,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2997" + - "2983" X-Ratelimit-Reset: - - "10" + - "7" status: 200 OK code: 200 duration: "" @@ -1294,12 +1294,12 @@ interactions: - GetMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: - body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:1594307245"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:1594307245} - by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050519,"multi":true,"name":"monitor - for datasource 1594307245","created":"2020-07-09T15:07:26.401982+00:00","created_at":1594307246000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:07:26.401982+00:00","overall_state_modified":null,"overall_state":"No + body: '{"restricted_roles":null,"tags":["baz","test_datasource_monitor:foo"],"deleted":null,"query":"avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} + by {host} > 2","message":"some message Notify: @hipchat-channel","id":20050771,"multi":true,"name":"monitor + for datasource test","created":"2020-07-09T15:22:49.680147+00:00","created_at":1594308169000,"creator":{"id":1445416,"handle":"frog@datadoghq.com","name":null,"email":"frog@datadoghq.com"},"org_id":321813,"modified":"2020-07-09T15:22:49.680147+00:00","overall_state_modified":null,"overall_state":"No Data","type":"query alert","options":{"notify_audit":false,"locked":false,"timeout_h":60,"silenced":{},"include_tags":true,"thresholds":{"critical":2.0,"warning":1.0,"warning_recovery":0.5,"critical_recovery":1.5},"new_host_delay":600,"require_full_window":true,"notify_no_data":false,"renotify_interval":60,"evaluation_delay":700,"escalation_message":"the situation has escalated @pagerduty"}}' headers: @@ -1312,13 +1312,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:30 GMT + - Thu, 09 Jul 2020 15:22:53 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1327,7 +1327,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - KHJbOoqp3I4BOBzIFnc/Ois3eg3Rjmudy0YalRpnXQEDXDoppykpDMDaJPIufi9t + - 2VXDwI2pcuhRZeQ6xt/fJh1koMYSfGcgQg5wAzgLqeh10Zf5/W946U7T5w6SEIhy X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1337,9 +1337,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2996" + - "2982" X-Ratelimit-Reset: - - "10" + - "7" status: 200 OK code: 200 duration: "" @@ -1353,10 +1353,10 @@ interactions: - DeleteMonitor User-Agent: - datadog-api-client-go/1.0.0-beta.6 (go go1.14.1; os darwin; arch amd64) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: DELETE response: - body: '{"deleted_monitor_id":20050519}' + body: '{"deleted_monitor_id":20050771}' headers: Cache-Control: - no-cache @@ -1367,13 +1367,13 @@ interactions: Content-Type: - application/json; charset=utf-8 Date: - - Thu, 09 Jul 2020 15:07:30 GMT + - Thu, 09 Jul 2020 15:22:53 GMT Dd-Pool: - dogweb Pragma: - no-cache Set-Cookie: - - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:07:30 GMT; + - DD-PSHARD=233; Max-Age=604800; Path=/; expires=Thu, 16-Jul-2020 15:22:53 GMT; secure; HttpOnly Strict-Transport-Security: - max-age=15724800; @@ -1382,7 +1382,7 @@ interactions: X-Content-Type-Options: - nosniff X-Dd-Debug: - - og1WGdy+2nV+rkkclmd3Cf2I26XhV3/6yjBeQCP8aHbH2k2cKwC+X9WmhIghcJ94 + - Xj/PwLDKe3Ll1QwGP2SdQuyUcOtG0YD60hQDJ9tPEhK9OEMHkSCPXdZRvPX0YYGO X-Dd-Version: - "35.2720045" X-Frame-Options: @@ -1396,7 +1396,7 @@ interactions: headers: User-Agent: - Datadog/dev/terraform (go1.14.1) - url: https://api.datadoghq.com/api/v1/monitor/20050519 + url: https://api.datadoghq.com/api/v1/monitor/20050771 method: GET response: body: '{"errors":["Monitor not found"]}' @@ -1410,7 +1410,7 @@ interactions: Content-Type: - application/json Date: - - Thu, 09 Jul 2020 15:07:31 GMT + - Thu, 09 Jul 2020 15:22:54 GMT Dd-Pool: - dogweb Pragma: @@ -1430,9 +1430,9 @@ interactions: X-Ratelimit-Period: - "10" X-Ratelimit-Remaining: - - "2995" + - "2981" X-Ratelimit-Reset: - - "10" + - "7" status: 404 Not Found code: 404 duration: "" diff --git a/datadog/data_source_datadog_monitor_test.go b/datadog/data_source_datadog_monitor_test.go index dbdc33f74..50db6878a 100644 --- a/datadog/data_source_datadog_monitor_test.go +++ b/datadog/data_source_datadog_monitor_test.go @@ -3,7 +3,6 @@ package datadog import ( "fmt" "testing" - "time" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" @@ -48,13 +47,13 @@ func checkDatasourceAttrs(accProvider *schema.Provider) resource.TestCheckFunc { return resource.ComposeTestCheckFunc( testAccCheckDatadogMonitorExists(accProvider, "datadog_monitor.foo"), resource.TestCheckResourceAttr( - "data.datadog_monitor.foo", "name", fmt.Sprintf("monitor for datasource %d", now)), + "data.datadog_monitor.foo", "name", "monitor for datasource test"), resource.TestCheckResourceAttr( "data.datadog_monitor.foo", "message", "some message Notify: @hipchat-channel"), resource.TestCheckResourceAttr( "data.datadog_monitor.foo", "type", "query alert"), resource.TestCheckResourceAttr( - "data.datadog_monitor.foo", "query", fmt.Sprintf("avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:%d} by {host} > 2", now)), + "data.datadog_monitor.foo", "query", "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} by {host} > 2"), resource.TestCheckResourceAttr( "data.datadog_monitor.foo", "notify_no_data", "false"), resource.TestCheckResourceAttr( @@ -86,16 +85,14 @@ func checkDatasourceAttrs(accProvider *schema.Provider) resource.TestCheckFunc { ) } -var now = time.Now().Unix() - -var testAccMonitorConfig = fmt.Sprintf(` +var testAccMonitorConfig = ` resource "datadog_monitor" "foo" { - name = "monitor for datasource %d" + name = "monitor for datasource test" type = "query alert" message = "some message Notify: @hipchat-channel" escalation_message = "the situation has escalated @pagerduty" - query = "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:%d} by {host} > 2" + query = "avg(last_1h):avg:aws.ec2.cpu{environment:foo,host:foo,test_datasource_monitor_scope:foo} by {host} > 2" thresholds = { warning = "1.0" @@ -113,9 +110,9 @@ resource "datadog_monitor" "foo" { include_tags = true require_full_window = true locked = false - tags = ["test_datasource_monitor:%d", "baz"] + tags = ["test_datasource_monitor:foo", "baz"] } -`, now, now, now) +` var testAccDatasourceMonitorNameFilterConfig = fmt.Sprintf(` %s @@ -123,9 +120,9 @@ data "datadog_monitor" "foo" { depends_on = [ datadog_monitor.foo, ] - name_filter = "monitor for datasource %d" + name_filter = "monitor for datasource test" } -`, testAccMonitorConfig, now) +`, testAccMonitorConfig) var testAccDatasourceMonitorTagsFilterConfig = fmt.Sprintf(` %s @@ -134,10 +131,10 @@ data "datadog_monitor" "foo" { datadog_monitor.foo, ] tags_filter = [ - "test_datasource_monitor_scope:%d", + "test_datasource_monitor_scope:foo", ] } -`, testAccMonitorConfig, now) +`, testAccMonitorConfig) var testAccDatasourceMonitorMonitorTagsFilterConfig = fmt.Sprintf(` %s @@ -146,7 +143,7 @@ data "datadog_monitor" "foo" { datadog_monitor.foo, ] monitor_tags_filter = [ - "test_datasource_monitor:%d", + "test_datasource_monitor:foo", ] } -`, testAccMonitorConfig, now) +`, testAccMonitorConfig)