Introduction to synthetic monitors (New Relic). Synthetic monitoring simulates user traffic from fixed locations to give deterministic uptime, response, and flow-level metrics; start by choosing a monitor type and a reachable execution location, and keep secrets out of script code to prevent credential leakage. The remainder of this guide gives five practical, actionable steps that reduce flakiness and make scripted browser checks and API tests reliable in production.

Step 1. Prepare Account Keys and Secrets
Create an API key scoped only for Synthetics automation or NerdGraph and store it in a centralized secret manager. Use New Relic’s secure-credentials feature to inject secrets at runtime instead of hard-coding them in monitors. When you need programmatic creation in CI, issue a dedicated key with the minimum required scope and rotate it on a schedule aligned with your CI credentials policy.
Step 2. Pick the Right Monitor Type
Select a monitor by the measurement you need. Use HTTP or Ping monitors for simple uptime and status-code checks; API monitors for JSON validation, header and certificate checks; Simple Browser for single-page load metrics; and Scripted Browser for multi-step user journeys that require DOM interaction. Prefer the simplest monitor that proves the business outcome to reduce runtime costs and reduce scripting surface area for failures.
Step 3. Configure Locations and Private Hosts
Deploy monitors from locations that can actually reach the target. Public nodes provide internet-facing perspective; private locations run inside your network for intranet, VPN, or firewall-limited endpoints. Check the documented quota and location rules before scaling: Synthetic monitoring limits. When private access is required, follow the private locations installation instructions and verify job manager health and key provisioning.

Step 4. Write Robust Scripted Browser Tests
Keep each scripted monitor focused on a single business flow and limit script length to improve debugability. Use element-based waits and the built-in driver APIs instead of fixed sleeps. Reference secure credentials through the secure object and verify each external resource the page loads so blocked assets are visible in the run artifacts. Encapsulate repeated steps into helper functions and assert both HTTP response codes and visible DOM state to reduce false positives.
Step 5. Validate Runs and Diagnose Failures
Run the monitor validate feature to execute tests interactively, then inspect artifacts such as screenshots, console logs, and HAR files. Use New Relic guidance to interpret timing metrics and where slow components live: Understand load times. For result interpretation and concrete UI on test runs, consult the run-results documentation: View simple and scripted monitor results. Compare a failing synthetic HAR and screenshot with a local reproduction and then isolate whether failures are selector mismatches, client-side timeouts, or network-level blocks.

Practical Configuration Checklist
| Item | Recommended Setting |
|---|---|
| Monitor Type | HTTP for endpoints; Scripted Browser for multi-step flows |
| Locations | Public for public sites; Private for internal apps |
| Timeout | 60 seconds default; increase for heavy JS pages |
| Frequency | Every 1-5 minutes for critical journeys; 15-60 minutes for low-risk checks |
| Artifact retention | Keep recent HARs and screenshots for at least 7 days for triage |
When you need example use cases to align monitor choices with business outcomes, review documented scenarios such as uptime SLA checks, checkout flow validation, API contract checks, and third-party dependency monitoring: Synthetic monitoring use cases. For purchasing or comparing complementary commercial tools and accessories that support synthetic testing or load generation, consider market comparisons: Amazon search: synthetic monitoring tools.
How to Use Private Locations Safely
Create private locations only when public nodes cannot reach the target. After creating a private location, install a job manager with the private location key, confirm the queue and host health, and restrict which hosts can run the job manager. Rotate private location keys periodically and apply host-based access controls to reduce the blast radius if a host is compromised.
Common Failure Modes and Quick Fixes
- API or secure credential errors. Fix: validate key scope and confirm the credential is attached to the monitor.
- Location cannot reach target. Fix: run a curl from the job manager host and verify DNS, proxies, and firewall rules.
- Broken selectors or timing. Fix: replace fixed sleeps with explicit waits and test selectors against the live DOM.
- Timeouts from heavy pages. Fix: raise monitor timeout or break the flow into smaller checks to isolate the slow component.
Automating Monitors With API and NerdGraph
Automate monitor provisioning to keep checks consistent across environments. Use the Synthetics REST API or NerdGraph mutations to create, update, and attach secure credentials programmatically; the documentation explains the endpoints and payloads required to upload BASE64-encoded scripts and configure monitors: Add and edit monitors. Apply environment-specific variables for URLs and credentials and run validation steps as part of CI to catch runtime issues before deployment.
Alerting Strategy and Triage Data
Match alert conditions to business impact. For critical user journeys, configure alerts to include the latest screenshot and HAR URL and require fewer consecutive failures. For noisy endpoints, require multiple consecutive failures or combine synthetics with backend metrics to reduce false positives. Put a concise runbook link and the most recent run artifacts directly in the alert payload so responders can triage without hunting for data.
Maintainability: Reduce Flakiness and Control Cost
Review monitors quarterly, remove obsolete checks, and lower frequency for low-risk endpoints. Replace scripted browser monitors with API checks where only response validity matters. Follow full-stack design guidance when sizing and operating your synthetic fleet: Synthetic monitoring best practices guide. Track private location health metrics and cost drivers such as frequency, number of locations, and artifact retention to balance coverage with budget.
Where to Read Official Docs
For a concise official overview and quick-start steps, use the summary page: Introduction to synthetic monitors (Summary). For an alternate phrasing of how to inspect run artifacts and results within the service docs, see: View simple and scripted monitor results (Service docs). These pages together describe setup steps, monitor types, result artifacts, and common troubleshooting tasks.
When a scripted monitor still fails after these checks, collect the run screenshot, console log, and HAR, reproduce the flow locally, and iterate on selectors or network configuration. Prioritize fixes that reduce alert noise and isolate failures to a single root cause so future incidents are faster to resolve.
Related Video
Getting synthetics monitoring to work in New Relic can seem complex, but following the right steps and understanding the platform's features can make the process smoother. Start with clear objectives for your monitoring, utilize New Relic’s documentation resources, and consider reaching out to the community for additional support. Over time, this setup will provide valuable insights into your application's performance.
More from Architecture Adrenaline
For ongoing tips and insights, check out more posts on our social channels. You can follow us on Instagram for updates and additional content relevant to your monitoring needs.
