How to Get Synthetics Monitoring to Work in New Relic
Introduction
New Relic is a popular application performance monitoring (APM) platform that provides deep visibility into system and application metrics. One of its most powerful features is synthetics monitoring. This allows simulating user journeys to proactively monitor uptime and performance.
What is New Relic?
For those unfamiliar, New Relic offers monitoring and troubleshooting for software systems. It instruments applications to aggregate telemetry data on transactions, errors, logs, and more. The data can then be analyzed through dashboards and alerts.
New Relic supports monitoring for various languages like Java, .NET, Ruby, Python, and Go. It also provides infrastructure monitoring, browser monitoring, and mobile monitoring.
Overview of Synthetics Monitoring
Synthetics monitoring creates scripted tests that mimic user actions. For example, loading a web page or calling an API endpoint. Tests are run from data centers around the world to catch issues before customers notice them.
Common tests include ping monitors, browser clickpaths, and API requests. Detailed response metrics are gathered to validate availability and performance. Alerts can also be configured to notify teams of any failures.
Benefits of Synthetics Monitoring
Synthetics monitoring provides many advantages:
- Catch availability and uptime issues proactively
- Identify performance degradations quickly
- Test from geo-distributed locations representing real users
- Validate user journeys span multiple services
- Alert on problems before customers are impacted
- Gain visibility without needing real user traffic
With the ability to simulate customer experiences worldwide, synthetics provides invaluable data. Let’s look at how to leverage it.
Getting Set Up with Synthetics
Using synthetics monitoring starts by signing up for New Relic and accessing the Synthetics page.
Signing up for New Relic
First, go to NewRelic.com and create a free account. Use your email and set a password. The free plan allows 100 million monthly data points.
Once registered, you can add your application for monitoring by installing the New Relic agent. Configuration details are provided.
Accessing Synthetics
After logging in, click on Synthetics in the left sidebar menu. This is where you’ll create and manage monitors.
Initially the page will be empty. Click Add monitor to begin configuring your first test.
Types of Monitors
The main types of monitors are:
- Simple ping – Checks endpoint response
- Browser – Clicks through web flows
- API – Calls endpoints by sending requests
We’ll walk through how to set up each type.
Configuring a Simple Ping Monitor
Ping monitors provide a basic uptime check. Let’s configure one:
Naming the Monitor
Give the monitor a name summarizing what it is checking – for example, “Google Homepage Ping”.
Setting Monitoring Frequency
Choose how often to run the check. Every 5 minutes is typical.
Choosing Locations
Pick which regions to check from. Ideally match key user locations.
Enabling Notifications
Get emailed whenever the monitor fails. Just add notifyees under notifications.
That covers the basics! Next let’s look at a more advanced browser monitor.
Creating a Browser Monitor
Browser monitors simulate interactions with your web application. Here’s how to set one up:
Defining URLs
Add the specific URLs and click paths to test. Use multiple steps if needed.
Configuring Browser Size
Select a browser size like desktop or mobile. Mimic real users.
Setting Check Frequency
Run every 5 minutes typically. Adjust as required.
Adding Assertions
Assertions validate page content loaded as expected. Check for text, images, or your header.
Browser monitors provide extensive web validation. Now let’s examine API testing.
Building an API Monitor
API monitors replicate calls to endpoints. Configure them by:
Selecting HTTP Method
Use GET, POST, PUT, etc based on the actual API call.
Adding Headers
Include any required headers like content-type.
Defining Request Body
Add a request body to pass data if required.
Validating Responses
Assertions can validate response codes, times, and contents.
This covers the basics of API monitoring. Next we’ll explore advanced options.
Using Advanced Configurations
Synthetics provides many advanced configurations:
Setting SLAs
Get alerts when performance drops below targets. Set thresholds for response times.
Recording Sessions
Optionally record monitors to replay later for debugging.
Adding Custom Headers
Insert additional headers beyond what’s predefined.
Debugging Monitors
Use troubleshooting tools to run monitors on demand.
These give extensive control over monitors. Now let’s look at using the data.
Analyzing and Using Monitor Data
Make the most of your monitors by:
Viewing Performance Metrics
Dashboards show response times, Apdex score, failures, and more.
Checking for Failures
Get alerts for any failed monitors, which could indicate an issue.
Creating Custom Alerts
Configure alerts on metrics like Apdex or response times.
Integrating with Other Products
Combine synthetics data with application metrics for context.
There are many ways to leverage the data. Next we’ll cover best practices.
Best Practices
Follow these guidelines to get the most from synthetics:
Choosing Monitor Types
Select monitor types matching what you are testing – ping, browser, or API.
Selecting Locations
Check from regions representing real users. Avoid misleading results.
Setting Frequency
Typically 5 minutes. Balance data needs with overhead.
Avoiding False Positives
Tune configurations to prevent meaningless alerts.
Adhering to best practices avoids pitfalls and ensures accurate monitoring.
Getting Support
If you need help with synthetics, reference:
Documentation
Consult New Relic’s thorough synthetics documentation.
Community Forums
The community forums provide guidance from other users.
Opening Support Tickets
Contact New Relic support if you get stuck.
Don’t hesitate to leverage these resources.
Conclusion
In summary:
- Synthetics monitoring simulates real user journeys for proactive testing
- New Relic offers ping, browser, and API monitors
- Monitors run from distributed locations worldwide
- Advanced configurations provide extensive control
- Monitor data offers visibility into user experiences
With the right set up, New Relic synthetics monitoring can provide invaluable uptime and performance visibility. Follow this guide to get it running for your critical applications.
FAQs
What is the difference between a ping test and a browser test?
A ping test checks basic uptime and responsiveness. A browser test clicks through workflows to simulate real usage.
How often should I run synthetics tests?
Typically every 5 minutes. For critical apps, every 1-2 minutes. Avoid excessive frequency.
What locations should I test from?
Locations representing your real users. This provides accurate results.
How do I debug failed tests?
Use troubleshooting tools to run on demand. Record sessions to replay. Check application logs.
What integrations are available for synthetics data?
Dashboards, custom alerts, and linking with other New Relic data for context.