Guide
Create a New Relic Synthetic API Monitor to Validate Endpoint Availability and Latency
Step‑by‑step guide to create a New Relic Synthetic API monitor that validates endpoint availability and latency, configures alerting, and includes verification and recovery actions.
Published by Tasadduq Burney
23 Aug 2025, 09:58 UTC
3 min17.1K views0

Desired outcome
You want a continuously running Synthetic API monitor that checks an HTTP endpoint for availability (2xx status) and latency, and fires a New Relic alert when the endpoint fails the success criteria.
Prerequisites
- A New Relic account with the Synthetics product enabled.
- A user API key (or user key) that has the
SyntheticsWritepermission. - The full URL of the endpoint you want to test (e.g.,
https://api.example.com/health). - Optional: any custom headers, query parameters, or request body required by the endpoint (e.g., an API token).
Procedure
-
Open the Synthetics UI
Log in to New Relic, navigate to
Synthetics > Monitors, and click Create a monitor. -
Select monitor type
Choose API test as the monitor type.
-
Define the request
- Enter a descriptive Monitor name (e.g.,
API‑Health‑Check‑Prod). - Paste the target URL into the URL field.
- Select the appropriate HTTP method (GET, POST, PUT, etc.).
- If needed, add headers under Headers (e.g.,
Authorization: Bearer {{token}}) and/or a request body.
- Enter a descriptive Monitor name (e.g.,
-
Choose locations and frequency
- Select one or more geographic locations where the monitor will run from (e.g.,
US East (N. Virginia),EU (Frankfurt)). - Set the run interval (e.g., Every 5 minutes).
- Select one or more geographic locations where the monitor will run from (e.g.,
-
Define success criteria
- Under Success criteria, set the acceptable status code range to
200‑299. - Set a maximum response time (e.g.,
2000ms) to catch latency regressions.
- Under Success criteria, set the acceptable status code range to
-
Create or attach an alert policy
- Click Create alert policy (or select an existing policy).
- Add a condition: Synthetic monitor → choose the monitor you just created → set the trigger to fire after
Xconsecutive failures (commonly2or3). - Configure a notification channel (email, Slack, PagerDuty, etc.) and save the policy.
-
Save the monitor
Review the summary and click Create monitor. The monitor will start running according to the frequency you set.
Expected checks
- After creation, go to
Synthetics > Monitorsand verify that the new monitor appears with a status of Running. - Open the monitor detail page and select the Results tab. The most recent run should show:
- Status code within the 200‑299 range.
- Response time below the threshold you defined.
- Confirm that the alert condition is listed under
Alerts > Policiesand that the associated notification channel is configured. - Optionally, trigger a manual test run from the monitor’s detail page (Run now) and inspect the response body, status code, and timing to ensure they match expectations.
Recovery options (if the monitor starts failing)
- Open the latest failed result in the Results tab to see the error (e.g., connection timeout, DNS failure, non‑2xx status).
- Check network connectivity from the selected locations and verify the endpoint’s health (e.g., via curl or a browser).
- If the failure is due to changed authentication or payload, edit the monitor:
- Navigate to
Synthetics > Monitors, select the monitor, click Edit. - Update headers, body, or URL as needed and save.
- Navigate to
- If the issue is persistent and you need to stop alerts while investigating, you can temporarily disable the monitor:
- In the monitor list, toggle the switch to Paused.
- After the underlying service is fixed, re‑enable the monitor.
- As a last resort, you can delete the monitor (which removes all historical data) and recreate it once the problem is resolved.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.