Skip to content

NewRelic Synthetic Monitors

Andy Potanin edited this page Jun 21, 2026 · 3 revisions

Creates NewRelic Synthetic monitors with alert policies and optional Slack notifications.

Use this module when a Rabbit service needs uptime monitoring with HTTP checks against specific endpoints, with per-monitor alert policies and Slack notifications.

Supported Features

  • Simple synthetic monitors with HTTP checks.
  • Multiple monitors per module instance.
  • Per-monitor enable/disable.
  • Configurable check periods and locations.
  • SSL verification.
  • Custom headers (including GCP Secret Manager-resolved values).
  • Per-monitor alert policies with NRQL conditions.
  • Slack notification destination, channels, and workflows per monitor.

Prerequisites

  • A NewRelic account and API key (provided via org-level secret NEWRELIC_API_KEY).
  • For Slack notifications: a Slack webhook URL.

Important Notes

  • base_url is resolved by R2A and combined with each monitor's path to form the full check URL.
  • Custom headers can reference GCP Secret Manager paths that R2A resolves before Terraform runs.
  • Each monitor creates its own alert policy and Slack workflow when Slack is configured.
  • runtime_type and runtime_type_version control the synthetic runtime (Chrome browser).

Minimal Example

services:
  - name: "NewRelic Synthetic Monitors"
    module: "newrelic-synthetic-monitors"
    id: "synthetics"
    deployment_order: 150
    configurations:
      slack:
        webhook_url: "projects/371202756643/secrets/SLACK_WEBHOOK_ROUTINE"
        channel: "#alerts"
      monitors:
        homepage:
          enabled: true
          path: "/"
          period: "EVERY_MINUTE"
          type: "SIMPLE"
          status: "ENABLED"
          locations:
            - "US_EAST_1"
          verify_ssl: true

Outputs

Output Description
monitor_ids Map of monitor keys to their NewRelic monitor IDs.
monitor_names Map of monitor keys to their display names.
monitor_status Map of monitor keys to their status.
alert_policy_ids Map of alert policy IDs per monitor.
slack_destination_id ID of the Slack notification destination (null if not configured).
slack_channel_ids Map of Slack notification channel IDs per monitor.
workflow_ids Map of workflow IDs for Slack notifications per monitor.

Full Configuration Schema

The fields below are public module inputs under configurations.

configurations:
  slack:
    webhook_url: ""
    channel: "#alerts"
  monitors:
    <monitor_key>:
      enabled: true
      path: "/"
      period: "EVERY_MINUTE"
      type: "SIMPLE"
      status: "ENABLED"
      runtime_type: "CHROME_BROWSER"
      runtime_type_version: "144"
      locations:
        - "US_EAST_1"
      verify_ssl: true
      custom_headers: {}

slack

Field Type Required Description
webhook_url string No Slack webhook URL or GCP Secret Manager path. Empty disables Slack.
channel string No Slack channel. Defaults to #alerts.

monitors

Field Type Required Description
enabled boolean No Enables this monitor. Defaults to true.
path string Yes URL path appended to the base URL.
period string No Check frequency: EVERY_MINUTE, EVERY_5_MINUTES, EVERY_10_MINUTES, EVERY_15_MINUTES, EVERY_30_MINUTES, EVERY_HOUR, EVERY_6_HOURS, EVERY_12_HOURS, or EVERY_DAY. Defaults to EVERY_MINUTE.
type string No Monitor type. Defaults to SIMPLE.
status string No Monitor status: ENABLED or DISABLED. Defaults to ENABLED.
runtime_type string No Synthetic runtime type. Defaults to CHROME_BROWSER.
runtime_type_version string No Runtime version. Defaults to 144.
locations array[string] Yes NewRelic public minion locations.
verify_ssl boolean No Verifies SSL certificates. Defaults to true.
custom_headers map[string] No Custom HTTP headers. Values can be GCP Secret Manager paths.

Clone this wiki locally