From 6f5bddb6b94491488ce1cc9afa4f5bf5471f8bd1 Mon Sep 17 00:00:00 2001 From: Craig Shanks <44571906+crshanks@users.noreply.github.com> Date: Mon, 2 Oct 2023 22:00:20 +0100 Subject: [PATCH] Add log api and metric synthetics --- synthetics-tests/monitor.tf | 54 ++++++++++++++++++++++++++++++++++--- 1 file changed, 51 insertions(+), 3 deletions(-) diff --git a/synthetics-tests/monitor.tf b/synthetics-tests/monitor.tf index 2de822d..0b029ff 100644 --- a/synthetics-tests/monitor.tf +++ b/synthetics-tests/monitor.tf @@ -16,13 +16,13 @@ resource "newrelic_synthetics_secure_credential" "apigee_test_insert_license_api description = "NR trace api insert license key" } -resource "newrelic_synthetics_script_monitor" "newrelic_trace_monitor" { - name = "newrelic-trace" +resource "newrelic_synthetics_script_monitor" "newrelic_log_monitor" { + name = "newrelic-log" type = "SCRIPT_API" locations_public = ["EU_WEST_2"] period = "EVERY_15_MINUTES" status = "ENABLED" - script = templatefile("./script.tftpl", { ENDPOINT = "/newrelic/trace", APIGEE_PROTOCOL = var.apigee_protocol, APIGEE_HOST = var.apigee_host, REGION = var.new_relic_region }) + script = templatefile("./script.tftpl", { ENDPOINT = "/newrelic/log", APIGEE_PROTOCOL = var.apigee_protocol, APIGEE_HOST = var.apigee_host, REGION = var.new_relic_region }) script_language = "JAVASCRIPT" runtime_type = "NODE_API" runtime_type_version = "16.10" @@ -48,6 +48,54 @@ resource "newrelic_synthetics_script_monitor" "newrelic_logging_monitor" { } } +resource "newrelic_synthetics_script_monitor" "newrelic_metric_monitor" { + name = "newrelic-metric" + type = "SCRIPT_API" + locations_public = ["EU_WEST_2"] + period = "EVERY_15_MINUTES" + status = "ENABLED" + script = templatefile("./script.tftpl", { ENDPOINT = "/newrelic/metric", APIGEE_PROTOCOL = var.apigee_protocol, APIGEE_HOST = var.apigee_host, REGION = var.new_relic_region }) + script_language = "JAVASCRIPT" + runtime_type = "NODE_API" + runtime_type_version = "16.10" + tag { + key = "terraform" + values = [true] + } +} + +resource "newrelic_synthetics_script_monitor" "newrelic_trace_monitor" { + name = "newrelic-trace" + type = "SCRIPT_API" + locations_public = ["EU_WEST_2"] + period = "EVERY_15_MINUTES" + status = "ENABLED" + script = templatefile("./script.tftpl", { ENDPOINT = "/newrelic/trace", APIGEE_PROTOCOL = var.apigee_protocol, APIGEE_HOST = var.apigee_host, REGION = var.new_relic_region }) + script_language = "JAVASCRIPT" + runtime_type = "NODE_API" + runtime_type_version = "16.10" + tag { + key = "terraform" + values = [true] + } +} + +resource "newrelic_synthetics_script_monitor" "newrelic_trace_and_metric_and_log_monitor" { + name = "newrelic-trace-and-metric-and-log" + type = "SCRIPT_API" + locations_public = ["EU_WEST_2"] + period = "EVERY_15_MINUTES" + status = "ENABLED" + script = templatefile("./script.tftpl", { ENDPOINT = "/newrelic/trace-and-metric-and-log", APIGEE_PROTOCOL = var.apigee_protocol, APIGEE_HOST = var.apigee_host, REGION = var.new_relic_region }) + script_language = "JAVASCRIPT" + runtime_type = "NODE_API" + runtime_type_version = "16.10" + tag { + key = "terraform" + values = [true] + } +} + resource "newrelic_synthetics_script_monitor" "newrelic_trace_and_logging_monitor" { name = "newrelic-trace-and-logging" type = "SCRIPT_API"