Repository navigation
NewRelic APM Browser
udx-github edited this page Sep 16, 2026
·
5 revisions
Creates NewRelic APM and Browser monitoring applications with alert policies and Slack notifications.
Use this module when a Rabbit service needs application performance monitoring, browser real-user monitoring, or both, with configurable alert thresholds and Slack notification workflows.
- APM alert policy with error rate, response time, and Apdex conditions.
- APM application settings configuration (when the agent has reported data).
- APM entity tags.
- Browser application creation with JavaScript snippet output.
- Browser alert policy with page load time, JS error, and AJAX error rate conditions.
- Shared alert signal defaults (evaluation window, occurrences, minimum sample size) with per-condition overrides, percentile-based duration alerts, and host/message exclusions for AJAX and JS error conditions.
- Slack notification destination, channels, and workflows for both APM and Browser alerts.
- Independent enable/disable for APM and Browser.
- A NewRelic account and API key available to the deployment runtime.
- For APM: an APM agent configured in the application reporting to NewRelic.
- For Slack notifications: a Slack webhook URL.
-
apm.app_namemust match the name reported by the APM agent. -
apm.configure_app_settingsshould only be set totrueafter the APM agent has reported data at least once. -
browser.enabled: truecreates a standalone Browser application and returns abrowser_js_configoutput containing the JavaScript snippet to embed in the site's<head>. - R2A placeholders (
#{Environment},#{Lifecycle},#{Owner},#{Repository}) are supported in tag values. -
slack.webhook_urlset to empty string disables Slack notifications. - Conditions evaluate 300-second windows and open only when every window in
threshold_durationbreaches. Rate and duration conditions ignore windows with fewer thanmin_sample_sizeevents (10 by default). Setalert_defaults.min_sample_size: 0to evaluate every window. -
threshold_durationis rounded up to a multiple of the condition'saggregation_window: at least one window, at most the largest multiple that fits in 86400 seconds. Anaggregation_windowoutside 30-21600 or an unknownthreshold_occurrencesfails the plan. -
browser.alerts.js_errors.thresholdcounts affected sessions per window by default (metric: sessions); setmetric: countfor raw error events.
services:
- name: "NewRelic APM and Browser"
module: "newrelic-apm-browser"
id: "newrelic"
deployment_order: 145
configurations:
apm:
enabled: true
app_name: "www-example-com-#{Environment}"
browser:
enabled: true
app_name: "www-example-com-#{Environment}-browser"
slack:
webhook_url: "projects/<project-id>/secrets/<slack-webhook-secret>"
channel: "#alerts"| Output | Description |
|---|---|
apm_entity_guid |
NewRelic entity GUID of the APM application (null if configure_app_settings is false). |
apm_alert_policy_id |
ID of the APM alert policy (null if APM is disabled). |
browser_application_id |
NewRelic application ID of the Browser app (null if Browser is disabled). |
browser_js_config |
JavaScript snippet for Browser monitoring (sensitive, null if Browser is disabled). |
browser_alert_policy_id |
ID of the Browser alert policy (null if Browser is disabled). |
slack_destination_id |
ID of the Slack notification destination (null if Slack is disabled). |
apm_workflow_id |
ID of the APM to Slack workflow (null if APM or Slack is disabled). |
browser_workflow_id |
ID of the Browser to Slack workflow (null if Browser or Slack is disabled). |
The fields below are public module inputs under configurations.
configurations:
slack:
webhook_url: ""
channel: "#alerts"
alert_defaults:
aggregation_window: 300
threshold_occurrences: "all"
min_sample_size: 10
apm:
enabled: false
app_name: ""
apdex_threshold: 0.5
configure_app_settings: false
enable_real_user_monitoring: true
transaction_tracer:
record_sql: "obfuscated"
threshold: 1.0
tags: {}
alerts:
error_rate:
enabled: true
threshold: 5
threshold_duration: 300
response_time:
enabled: true
statistic: "average"
threshold: 2.0
threshold_duration: 300
apdex:
enabled: true
threshold: 0.75
threshold_duration: 300
browser:
enabled: false
app_name: ""
cookies_enabled: true
distributed_tracing_enabled: true
loader_type: "SPA"
tags: {}
alerts:
page_load_time:
enabled: true
statistic: "p75"
threshold: 5.0
threshold_duration: 300
js_errors:
enabled: true
metric: "sessions"
threshold: 5
threshold_duration: 300
exclude_messages: ["Script error."]
ajax_error_rate:
enabled: true
threshold: 5
threshold_duration: 300
min_status_code: 400
include_hosts: []
exclude_hosts: ["browser", "bam.nr-data.net", "bam-cell.nr-data.net", "js-agent.newrelic.com"]Every entry under apm.alerts.* and browser.alerts.* also accepts aggregation_window, threshold_occurrences, and min_sample_size to override alert_defaults for that condition.
| 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. |
| Field | Type | Required | Description |
|---|---|---|---|
aggregation_window |
number | No | Evaluation window in seconds for every condition (30-21600). Defaults to 300. |
threshold_occurrences |
string | No |
all (every window in threshold_duration must breach) or at_least_once. Defaults to all. |
min_sample_size |
number | No | Minimum events per window before a rate or duration window can breach; 0 disables. Defaults to 10. Not applied to js_errors. |
| Field | Type | Required | Description |
|---|---|---|---|
enabled |
boolean | No | Enables APM monitoring. Defaults to false. |
app_name |
string | Conditional | APM application name. Required when enabled is true. |
apdex_threshold |
number | No | Apdex T value in seconds. Defaults to 0.5. |
configure_app_settings |
boolean | No | Configures app settings (only after agent reports data). Defaults to false. |
enable_real_user_monitoring |
boolean | No | Enables browser auto-instrumentation via APM. Defaults to true. |
transaction_tracer.record_sql |
string | No | SQL recording mode. Defaults to obfuscated. |
transaction_tracer.threshold |
number | No | Transaction tracer threshold in seconds. Defaults to 1.0. |
tags |
map[string] | No | Entity tags for the APM app. |
alerts.error_rate.enabled |
boolean | No | Enables error rate alert. Defaults to true. |
alerts.error_rate.threshold |
number | No | Error rate threshold (%). Defaults to 5. |
alerts.error_rate.threshold_duration |
number | No | Duration in seconds. Defaults to 300. |
alerts.response_time.enabled |
boolean | No | Enables response time alert. Defaults to true. |
alerts.response_time.statistic |
string | No |
average, median, p75, p90, p95, or p99 of transaction duration. Defaults to average. |
alerts.response_time.threshold |
number | No | Response time threshold in seconds. Defaults to 2.0. |
alerts.response_time.threshold_duration |
number | No | Duration in seconds. Defaults to 300. |
alerts.apdex.enabled |
boolean | No | Enables Apdex alert. Defaults to true. |
alerts.apdex.threshold |
number | No | Apdex score threshold (0-1). Defaults to 0.75. |
alerts.apdex.threshold_duration |
number | No | Duration in seconds. Defaults to 300. |
alerts.*.aggregation_window |
number | No | Per-condition override of alert_defaults.aggregation_window. |
alerts.*.threshold_occurrences |
string | No | Per-condition override of alert_defaults.threshold_occurrences. |
alerts.*.min_sample_size |
number | No | Per-condition override of alert_defaults.min_sample_size. |
| Field | Type | Required | Description |
|---|---|---|---|
enabled |
boolean | No | Enables Browser monitoring. Defaults to false. |
app_name |
string | Conditional | Browser application name. Required when enabled is true. |
cookies_enabled |
boolean | No | Enables cookies. Defaults to true. |
distributed_tracing_enabled |
boolean | No | Enables distributed tracing. Defaults to true. |
loader_type |
string | No | Browser agent loader type: SPA, PRO, or LITE. Defaults to SPA. |
tags |
map[string] | No | Entity tags for the Browser app. |
alerts.page_load_time.enabled |
boolean | No | Enables page load time alert. Defaults to true. |
alerts.page_load_time.statistic |
string | No |
average, median, p75, p90, p95, or p99 of page load duration. Defaults to p75. |
alerts.page_load_time.threshold |
number | No | Page load time threshold in seconds. Defaults to 5.0. |
alerts.page_load_time.threshold_duration |
number | No | Duration in seconds. Defaults to 300. |
alerts.js_errors.enabled |
boolean | No | Enables JS error alert. Defaults to true. |
alerts.js_errors.metric |
string | No |
sessions (unique sessions with an error) or count (error events). Defaults to sessions. |
alerts.js_errors.threshold |
number | No | Sessions or events per window. Defaults to 5. |
alerts.js_errors.threshold_duration |
number | No | Duration in seconds. Defaults to 300. |
alerts.js_errors.exclude_messages |
list[string] | No | Substrings; errors whose message contains one are ignored. Defaults to ["Script error."]. |
alerts.ajax_error_rate.enabled |
boolean | No | Enables AJAX error rate alert. Defaults to true. |
alerts.ajax_error_rate.threshold |
number | No | AJAX error rate threshold (%). Defaults to 5. |
alerts.ajax_error_rate.threshold_duration |
number | No | Duration in seconds. Defaults to 300. |
alerts.ajax_error_rate.min_status_code |
number | No | Lowest HTTP status counted as an error. Defaults to 400. |
alerts.ajax_error_rate.include_hosts |
list[string] | No | When non-empty, only requests to these hostnames are evaluated. Defaults to []. |
alerts.ajax_error_rate.exclude_hosts |
list[string] | No | Hostnames removed from the population. Defaults to the Browser agent beacon hosts (browser, bam.nr-data.net, bam-cell.nr-data.net, js-agent.newrelic.com). |
alerts.*.aggregation_window |
number | No | Per-condition override of alert_defaults.aggregation_window. |
alerts.*.threshold_occurrences |
string | No | Per-condition override of alert_defaults.threshold_occurrences. |
alerts.*.min_sample_size |
number | No | Per-condition override of alert_defaults.min_sample_size (not used by js_errors). |
- AWS ACM Certificate
- AWS CloudFormation Stack
- AWS CloudFront Distribution
- AWS CloudFront Response Headers Policy
- AWS Route53 DNS
- AWS WAF
- Elasticsearch
- GCP Cloud Function
- GCP Cloud Run
- GCP Cloud Scheduler
- GCP Firebase Realtime Database (
gcp-firebase-rtdb) - GCP Firestore Database (
gcp-firestore) - GCP GKE Cluster
- GCP GKE Node Pool
- GCP IAM
- GCP Monitoring
- GCP Networking
- GCP PostgreSQL Instance
- GCP Pub/Sub
- GCP Secret Manager
- GCP Service Account
- GCP SQL Instance
- GCP Static IP
- GCP Storage
- Ghost Inspector Sync
- Imgix Source
- K8s Access
- K8s ARC Controller
- K8s ARC Runner
- K8s ConfigMap
- K8s Deployment
- K8s HPA
- K8s HTTP Gateway Route
- K8s HTTP Health Check Policy
- K8s Memcached
- K8s Namespace
- K8s PDB
- K8s Secret
- K8s Service
- K8s Shared HTTP Gateway
- NewRelic APM Browser
- NewRelic Synthetic Monitors