How to Get Synthetics Monitoring to Work in New Relic

As an engineer focused on site reliability, you know how critical it is to detect issues as quickly as possible. How to Get Synthetics Monitoring to Work in New Relic With New Relic Synthetics, you have a powerful tool for monitoring the availability and performance of your web applications. However, to get the most out of Synthetics and configure a truly robust monitoring setup, you need to invest the time to plan and optimize your configuration.

This article provides practical guidance for maximizing the effectiveness of New Relic Synthetics. You will learn how to determine the right monitoring locations, types of tests, and test frequencies for your needs. Recommendations for alerting and reporting configurations will help you gain visibility into the performance of your application from end to end. By following the best practices outlined here, you can deploy Synthetics to catch issues early, minimize downtime, and deliver an exceptional digital experience to your users.

Why Is Synthetics Monitoring Important?

Synthetics monitoring is essential for any business relying on web and mobile applications. By proactively simulating user interactions with your apps, you gain insights into performance and availability from the end user perspective.

  • Synthetics monitoring checks your app functionality and performance at regular intervals from locations around the world. This helps identify issues before your actual users are impacted, reducing downtime and improving the customer experience.
  • You can configure browser and API tests to monitor specific user flows or backend API calls critical to your app. Set up tests to run as frequently as every 5 minutes so you’re alerted to problems fast.
  • When a test fails or performance degrades, you’ll receive an alert so you can start investigating immediately. With the detailed test results and metrics in New Relic, you can diagnose issues quickly and get your app back to full functionality.
  • Over time, synthetics monitoring gives you a baseline for normal performance and availability so anomalies stand out. You’ll gain insights into how new features or infrastructure changes impact users. You can even correlate synthetics and real user data to better understand the user experience.
  • Robust monitoring is essential for any digital business. Synthetics monitoring through New Relic provides an automated, consistent view into your application’s performance and availability so you can optimize the user experience. By taking a proactive approach, you’ll spend less time reacting to issues and more time building great software.

With New Relic Synthetics, you have a powerful tool for improving your application’s reliability and user experience through robust monitoring. Configuration may require an initial time investment, but the long-term benefits to your business and customers will be well worth it.

Creating Your First Synthetic Monitor

To begin monitoring the availability and performance of your web applications, you’ll need to create your first synthetic monitor in New Relic.

  1. From the Synthetics page, click โ€œAdd Monitorโ€ to get started. You’ll be prompted to select the type of monitor you want to configure. The two options are:
  2. Browser: Simulates a real user accessing a web page. Used to monitor availability, functionality, and performance of websites and web applications.
  3. API: Makes requests to API endpoints. Used to monitor the availability, functionality, and performance of APIs and microservices.
  4. For this example, select โ€œBrowserโ€ to set up a basic webpage monitor. Name your monitor and provide a description to help identify its purpose.
  5. Enter the URL of the page you want to monitor. You can also select optional authentication if the page requires a login.
  6. Choose a monitoring frequency of 1, 5, or 15 minutes to determine how often the synthetic monitor will run. For most webpages, 5 or 15 minutes is sufficient.
  7. Select locations to monitor from. Choose areas that match where your real users are accessing the web application for the most accurate data.
  8. Optionally, you can configure advanced options like request headers, request methods, and expected response codes. But for a simple webpage monitor, the basic options are enough to get started.
  9. Once configured, click โ€œSave and Deployโ€ to activate your new synthetic monitor. It will begin monitoring your webpage and reporting data within the next monitoring frequency period.

With your first synthetic monitor up and running, you’ll gain valuable insight into the availability and performance of your web applications from real user locations. Be sure to check back on your monitor’s health and make any needed tweaks to the configuration. Synthetics monitoring is a powerful tool, and with the right setup can help ensure optimal end-user experiences.

Choosing the Right Monitor Type: Simple, Browser, or Scripted

Simple Monitors

Simple monitors check How to Get Synthetics Monitoring to Work in New Relic if a web page or API endpoint is reachable and responding. They simply ping the URL and check for a 200 response code. These are good for basic uptime monitoring and ensuring critical web pages or APIs are available.

To create a simple monitor in New Relic, select the โ€œSimpleโ€ monitor type. Enter the URL you want to check and a name for your monitor. Choose an interval How to Get Synthetics Monitoring to Work in New Relic for how often you want the check to run. For most websites, every 5-15 minutes is typical. You can then choose alert conditions if the monitor fails.

Browser Monitors

Browser monitors actually load a web page with a real browser and can check for specific content on the page. These allow you to monitor not just uptime but also the user experience. You can check for:

  • Text on the page like headers, buttons or messages
  • Images, videos, or other media loading properly
  • Forms, links or interactive elements functioning as expected
  • CSS or JavaScript errors that could impact the user experience

To create a browser monitor, select the โ€œBrowserโ€ type. Enter the URL and monitor name like before but then you can choose to check for specific text, images, or errors on the page. These monitors give you the most comprehensive view into web page availability and performance.

Scripted Monitors

For monitoring APIs, databases, or other backend systems, scripted monitors are the way to go. You can write simple scripts in languages like Python, Ruby, Bash, or Node.js to query your system and check for the proper response. Some examples of what you could monitor include:

  • API response times
  • Database query performance
  • Cache hit rates
  • Background job queue lengths

Scripted monitors give you ultimate flexibility to monitor any part of your tech stack. To create a scripted monitor, you’ll select the โ€œScriptโ€ type and then write your monitoring script right in the New Relic UI.

Using a mix of these monitor typesโ€”simple, browser, and scriptedโ€”will provide comprehensive 24/7 monitoring of your web services and applications. Be sure to choose alert conditions for critical monitors so you’re notified immediately if there are any issues. With active monitoring set up, you’ll gain full visibility into the performance and availability of your systems.

Setting an Appropriate Check Frequency

To effectively monitor your application, itโ€™s critical to set an appropriate check frequency for your Synthetics monitors. Too frequent, and you risk false positives or alert fatigue. Too infrequent, and you may miss critical issues. Finding the right balance is key.

Start conservatively

When you first set up Synthetics, begin with a conservative check frequency, such as every 5 or 10 minutes. This allows you to establish a performance baseline and ensure your checks are configured properly before ramping up the frequency. As you gain confidence in the data, you can adjust the frequency to match your needs.

Consider your use case

The check frequency you choose depends on what you’re monitoring and your application’s needs. For example:

  • Business-critical checks (e.g. login page, checkout flow) How to Get Synthetics Monitoring to Work in New Relic may need a higher frequency, such as every 2-5 minutes.
  • Less critical checks can use a lower frequency, such as every 10-15 minutes.
  • Checks that monitor background jobs or overnight processes may only need to run every 30 minutes to a few hours.

Watch for trends

Once your checks are running, monitor the results to watch for trends. If you start to see intermittent failures or performance dips around a certain time period, you may need to increase the check frequency during those times to gain better visibility. You can then adjust or resolve the underlying issues.

Consider costs

More frequent checks mean higher costs, as you are consuming more Synthetics resources. Strike a balance between check frequency and budget. If needed, you can start at a higher frequency and then scale back once you have addressed any initial issues. You can also set up alerts to notify you of failures so you don’t have to check results as often.

With some experimentation, you’ll find the optimal check frequency for your needs. Start conservative, consider your use cases, watch for trends, and keep costs in mind. How to Get Synthetics Monitoring to Work in New Relic Adjust as needed to gain visibility and confidence that your application is up and running. With the right frequency, Synthetics can provide robust monitoring for your system.

Defining Success and Failure Conditions

To fully utilize Synthetics monitoring in New Relic, you must properly define success and failure conditions for your tests. These conditions determine how New Relic will evaluate the results of your Synthetics tests and alert you to potential issues.

Define Success Conditions

Success conditions specify the expected results for a normal, functioning system. For an API test, a success condition could be a 200 OK status code and a response time under 500ms. For a browser test, it could be a specific text string on the page and no JavaScript errors.

Specify multiple, specific success conditions to ensure your test is comprehensive. For example, donโ€™t just check for a 200 status codeโ€”also check that the response contains expected values. The more granular your success conditions, the more accurately your test will monitor system health.

Set Failure Conditions

Failure conditions trigger alerts to notify you when something is wrong. They should detect issues that would negatively impact a user, like a 404 status code, slow response time, broken page element, or JavaScript error.

For the most effective monitoring, define both soft failure and hard failure conditions. A soft failure could indicate a small issue to investigate, like a response time over 1s. A hard failure should trigger immediate action, e.g. a 500 status code or completely blank page.

Soft failures allow you to catch problems before they become critical, hard failures help avoid downtime. Set the sensitivity of your failure conditions based on your needs and risk tolerance. Start broadly, then refine over time based on observed issues.

Review and Refine

Once your Synthetics test has run for a while, review the success and failure conditions. Check that youโ€™re getting alerts when you expect them, and not getting false positives. Look for new potential issues to add as soft or hard failure conditions. Update your success conditions to detect changes to the system under test.

Continually optimizing your Synthetics conditions ensures maximum monitoring coverage and accuracy. With robust, comprehensive success and failure conditions defined, you’ll get the alerts you need to keep your system functioning optimally.

Adding Web Page Checks to Track Availability

To monitor the availability and performance of your web applications in New Relic, you can configure Synthetics to run automated checks on specific web pages. These web page checks will test that your pages are loading as expected and report any issues.

Adding a Web Page Check

To add a web page check in New Relic Synthetics, follow these steps:

  1. Navigate to Synthetics in the New Relic menu and select How to Get Synthetics Monitoring to Work in New Relic โ€œPage load tests.โ€ Click โ€œAdd test.โ€
  2. Enter a name for your test that clearly identifies the web page, like โ€œHome page load test.โ€ Add tags to categorize the test.
  3. Enter the full URL of the web page you want to check, for example, โ€œhttps://www.example.com/โ€. Only enter the path for internal pages.
  4. Select a test frequency. For critical web pages, choose โ€œ1 minute.โ€ For less important pages, โ€œ5 minutesโ€ is reasonable.
  5. Choose locations to run the test from. Select locations close to your users for the most accurate results. More locations mean higher uptime guarantees.
  6. Click โ€œSave and deployโ€ to create your web page check.

The web page check will begin running instantly and results will populate your page load test dashboard. Look for average response times, pass/fail rates, and any failures or errors. Failed checks or long load times could indicate performance issues or downtime and should be investigated.

Web page checks provide insight into real user experiences with your web applications. By configuring checks on critical entry points and conversion pages, you gain visibility into availability and can ensure optimal performance and uptime. Using New Relic Synthetics, you have the tools to stay on top of your web applications and provide the best end-user experiences.

Monitoring API Endpoints With API Tests

Configuring API Tests

To monitor the performance and availability of your API endpoints, you’ll want to set up API tests in New Relic. API tests simulate calls to How to Get Synthetics Monitoring to Work in New Relic your API endpoints and report metrics like response time, throughput, and error rates.

To create an API test in New Relic:

  1. Navigate to Synthetics and click “Create Monitor.” Select “API Test” as the monitor type.
  2. Give the test a name and select an API endpoint to monitor. You can monitor any HTTP-based API.
  3. Choose a test frequency. Most customers start with 5-minute intervals and adjust from there based on their needs. More frequent tests provide higher sensitivity while less frequent tests conserve Synthetic credits.
  4. Enter request details. Specify the HTTP method, How to Get Synthetics Monitoring to Work in New Relic headers, query parameters, and body for your API request. You can hard code values or use variables and data sources to make dynamic requests.
  5. Choose an alert threshold. Set the threshold for response time (in seconds) that will trigger an alert. An alert will notify you if the API response time exceeds your threshold.
  6. Select locations to run the test from. Run the test from multiple locations to monitor your API performance from different geographic regions.
  7. Review and save your test. Double check all the details and then save your new API test. It will start running immediately based on the frequency you chose.

Monitoring the Results

Once your API test is running, you’ll see performance metrics and test results reported in New Relic. Track metrics like:

  • Average response time and throughput for all locations. Look for any spikes that could indicate performance issues.
  • Error rates and response codes. Monitor for increases in 404 or 500 errors which could point to API problems.
  • Alerts. Check if any alerts have been triggered due to slow response times. Investigate and resolve any API performance issues.

API tests provide crucial insights into the health and availability of your API endpoints. Be sure to review API test results regularly to catch any issues early and optimize API performance. How to Get Synthetics Monitoring to Work in New Relic Configuring robust API monitoring will help ensure a seamless experience for your API consumers.

Simulating User Journeys With Browser Monitors

To gain valuable insights into your user experience, configure Browser Monitors within New Relic Synthetics. These monitors simulate user journeys through your website or web application to detect performance issues and broken functionality.

Configuring a Browser Monitor

To configure a Browser Monitor, first select the locations you want to monitor from. It is recommended to choose regions where your users are located for the most accurate data. Next, define the browser and screen resolution to use. Choose a browser and resolution that represents a sizable portion of your users.

Then, you must specify the frequency of monitoring. For most websites, every 5-15 minutes is a good target range. More frequent monitoring, such as every minute, risks generating an excess of data and false positives. Less frequent monitoring may miss vital issues. Select a frequency based on your website traffic and business needs.

Finally, you must configure the actual user journey by either recording a live user flow or manually building a script. Recording a live user journey will automatically generate a script that can be customized as needed. Manually building a script involves adding navigation steps, inputting values into forms, clicking elements, waiting for pages to load, and asserting elements are present. Be sure to include critical user flows that represent typical use cases. The more comprehensive the journey, the more issues you can detect.

Reviewing Browser Monitor Results

Results from Browser Monitors are shown within New Relic Synthetics, allowing you to see details for each monitor run, such as response times, errors, and failures. Failed monitor runs indicate broken functionality or performance issues that require investigation. Reviewing geographical data can also uncover location-specific problems. Browser Monitor results should be checked regularly to ensure optimal user experiences across locations and devices. Configuring robust Browser Monitors and reviewing their results frequently is key to proactively monitoring user experience.

Synthetics Monitoring FAQs: Troubleshooting Common Issues

Checking Your Synthetics Monitor Status

To ensure your Synthetics monitors are functioning properly and providing accurate data, regularly check their status in the New Relic UI. Navigate to Synthetics > Monitors to view the list of all configured monitors. Check that each is reporting as โ€œEnabledโ€ with a green status dot, indicating it is actively running and reporting data. If any monitors show as โ€œDisabledโ€ or have a warning icon, investigate and resolve any issues immediately.

Troubleshooting Common Errors

Some frequent errors you may encounter with Synthetics monitors include:

  • Authentication issues: If your monitor is attempting to access a private API or webpage, ensure any required login credentials or API keys are correctly configured. Double check that the user account has appropriate permissions.
  • URL or endpoint not found: This typically indicates that the URL or API endpoint specified in your monitor configuration is invalid or has changed. Update the monitor with the correct URL/endpoint and re-enable it.
  • SSL certificate errors: If your monitor is attempting to access a secure URL (HTTPS), ensure that the SSL/TLS certificate is valid and trusted. You may need to update the monitor to ignore SSL verification or use a custom CA cert.
  • Timeout errors: If a monitor is timing out, it usually means that the request is taking too long to complete. You may need to increase the timeout value in the monitor configuration to allow more time for a response. This could also indicate an issue with the web application or API being monitored.
  • 5xx status codes: Monitor for 5xx status codes like 500 (Internal Server Error) or 503 (Service Unavailable) that indicate problems with the web application or API. Look into the cause of these errors and work to resolve them.

Re-enabling Monitors

Once you have addressed any issues causing a monitor to report disabled or in an error state, you must manually re-enable the monitor in the New Relic UI for it to resume running and reporting data. Navigate to the Monitors page, locate the monitor you wish to re-enable, How to Get Synthetics Monitoring to Work in New Relic and click the โ€œEnableโ€ button. The monitor status should update to โ€œEnabledโ€ with a green circle, indicating it is again actively monitoring.

Conclusion

In conclusion, by leveraging New Relic Synthetics to configure robust monitoring, you’ll gain valuable insights into the performance and availability of your applications.The ability to simulate user interactions and transactions, paired with flexible alerting options, gives you an end-to-end view of how your systems are functioning from a user’s perspective. With the knowledge and control provided by New Relic Synthetics monitoring, you’ll have the tools to optimize your software and infrastructure for maximum performance, reliability, and an exceptional customer experience. Continuous monitoring is key to success in today’s digital world. New Relic Synthetics delivers.

You May Also Like

More From Author

+ There are no comments

Add yours