New Relic Insights

Balu
8 min readOct 12, 2020

--

Why New Relic?

Imagine you have to build an app that could be a social media website, an e-commerce site, electronic money, or an online game, etc. Normally you host it in the cloud or in your own data center. In the beginning, you see that it is working perfectly, usually due to the low traffic. As time passes, the number of people visiting the App increases. If this increases drastically, you will notice that your pages have slowed down and the customers are unhappy with your service which results in your sales going down. Here you wouldn’t know where to begin or how to fix it. This is where New Relic comes to your aid.

What is New Relic?

New Relic is a Software as a Service offering that focuses on performance and availability monitoring. It uses a standardized Apdex (application performance index) score to set and rate application performance across the environment in a unified manner.

New Relic Insights data used to analyze user behavior, business transactions, customer insights, and more. Insights help people to visualize trends, create real-time dashboards and customizable charts for your metrics. It aids the users by helping them build better apps and make better decisions. Using the Insights interface, you can quickly and easily build dashboards to identify problems with your apps and hosts in real-time or to track ongoing data trends.

Key features of New Relic include:

  1. Software as a service (SaaS) — There is no installation required for New Relic. It can be accessed from anywhere and at any time.
  2. Simpler and easy to use.
  3. Availability monitoring — you will have access to a nice report which will visually show you when any downtime has occurred.
  4. Customer Error Recording — New Relic will record customer errors for you and gives you a nice graph. You can also see the stack trace for each error.
  5. Transaction tracking — you will be able to see where your application is spending most of its time.
  6. External Service Call recording — whenever you make calls to other services from within your app (e.g. an HTTP request to an API like Twitter), New Relic will monitor these as external calls. Often these external services can significantly degrade the performance of your app, especially if you make these calls in-process. New Relic can show which of your external calls are slowest, which ones you call the most, and which respond to the slowest on average.
  7. Scalability and Capacity analysis — you can tell straight away how well your app is scaling, you can do load tests and instantly see if your application can handle the load. You can observe your application response time trends as your user base grows and predict when you’ll need to add capacity.

How does it work?

New Relic Application hosted on the cloud in order to use it you have to sign up the New Relic website with license and start using a new relic. you won’t able to have new relic on-premises you can just use the service you can collect information from your servers from your browser from your mobile apps then send the information to New Relic and you can analyze the data and will allow you to visualize data.

The following diagram shows a complete view of incident management solutions for a cloud-based application.

Specifically, you can see how New Relic monitors the application, along with other selected toolchains.

The following flow describes the setup and operations of this solution in an overall cloud service management space:

  1. The online application in this solution is hosted in a public cloud environment and bound to the New Relic service. New Relic agents Java, PHP, and Node.js are added to the application.
  2. Agents allow the service to capture the alerts or exceptions from the application and display them on the New Relic dashboard.
  3. The New Relic service is integrated into other tools using various channels like Email, Webhook, Hipchat, Campfire, and PagerDuty
  4. Correlates events and, depending on policies and rules, generates necessary alerts and publishes them to third-party collaboration tools like Slack by using Webhook Channel. With Slack, incident owners and incident specialists collaborate and work together to validate issues or use dashboard tools to inspect and resolve the issues.

Installation Process — Java:

prerequisite :

  • Make sure you have signed up for a New Relic Account
  • OpenJDK and AdoptOpenJDK JVM versions 7 to 15 for Linux, Windows, and macOS
  • Oracle Hotspot JVM versions 7 to 15 for Linux, Solaris, Windows, and macOS

STEPS:

  • Download newrelic-java.zip and unzip newrelic-java.zip
  • example using curl: curl -O https://download.newrelic.com/newrelic/java-agent/newrelic-agent/current/newrelic-java.zip
  • Go to the unzipped installation file, and inside the newrelic subdirectory, edit newrelic.yml
  • Find the line with license_key.
  • Replace ‘<%= license_key %>’ with your license
  • For example: license_key: 456n20n1367ov2s174v51nvn789d21s67v26NRAL
  • Find the line with app_name.
  • Replace My Application with a name that helps you identify the application. For example app_name: Tide APP
  • Save and close newrelic.yml.

Agent Installation:

The Java agent installation involves copying all the unzipped New Relic files into the directory structure of your application server/container.

example:

  • In your application server/container directory structure, create a directory for New Relic files (for example, /opt/newrelic)
  • Copy all the New Relic files from your unzipped newrelic directory into your new directory.
  • Make sure that your application server/container includes this option when it starts Java -javaagent:/full/path/to/newrelic.jar (configure in JVM Arguments)

Restart your Application (you successfully installed Agent 🥳 🥳 )

Application Performance Index (Apdex)

Apdex is an industry standard to measure users’ satisfaction with the response time of applications and services. It’s a simplified Service Level Agreement (SLA) solution that helps you see how satisfied users are with your app through metrics such as Apdex score and dissatisfaction percentage instead of easily skewed traditional metrics such as average response time.

How do we measure Apdex?

Apdex is a measure of response time based on a set threshold. It measures the ratio of satisfactory response times to unsatisfactory response times. After you define a response time threshold T, all responses handled in T or less time satisfy the user.

For example, if T is 1.2 seconds and a response completes in 0.5 seconds, then the user is satisfied. All responses greater than 1.2 seconds dissatisfy the user. Responses greater than 4.8 seconds frustrate the user.

Working with Applications and Analyzing Instrumentation Data:

Dashboards: gather and chart the specific data you want to see, the way you want to see it, from anywhere in the New Relic platform.

With New Relic One dashboards you can customize and understand the data you collect. Explore your data and correlate connected sources with tailored, user-friendly charts, and quickly learn the state of your system and applications for faster, more efficient troubleshooting.

To access dashboards, go to one.newrelic.com and click on Dashboards on the top navigation menu.

Error Analytics:

Investigate error information by grouping and filtering the data. Add new errors to APM, prevent certain errors from being reported, and configure expected errors. Get alerts about errors and Review stack traces, logs, and other details and share the error information with charts and dashboards.

To access Go to one.newrelic.com > APM > (select an app) > Events > Errors.

Monitoring Database Operations:

In APM, the Database page shows an application’s database and cache data. The page shows individual database transactions as a sortable table, and operations, throughput, and response time as charts. If slow queries have been reported, they are shown when you select a transaction.

To access Go to one.newrelic.com > APM > (select an app) > Monitor > Databases.

Monitoring External Services:

In APM External services page provides charts with your external services by response time and external calls per minute. You can also sort the list of external services by the slowest average response time, most time consuming, or highest throughput (requests per minute). In UI, this is also referred to as web external or background external data.

To access Go to one.newrelic.com > APM > (select an app) > Monitor > External services.

Creating and Managing Alerts:

With New Relic’s infrastructure monitoring, you can create alert conditions directly within the context of what you are currently monitoring with New Relic. you can immediately select your filter set and tailor the alert condition directly from the chart you are viewing. This helps you proactively manage and monitor the alerting system for your environment. Any alert violations will be created per entity within the filter set.

steps to create Alert:

  1. In the one.newrelic.com top nav, click Alerts & AI, then click Policies.
  2. On the policy index page, click New alert policy.
  3. Type a meaningful name for the policy.
  4. Select the incident preference.
  5. Select Create alert policy.

Notification channels:

You can use alerts to set up notification channels. your selected channels provide fast and consistent ways for the right personnel to be notified about incidents. For example, notifications allow you to include charts about the incident to provide context and share them with your team.

Alerts offer several notification channels, including webhooks, Slack rooms, email, and more. You’ll be notified by your notification channels when incidents are opened, acknowledged, or closed.

steps to Add or Remove Notification channel:

  1. On the Notification channels, click New notification channel.
  2. Select the type of channel
  3. Select a specific notification channel, select Alert policies, and add or remove a policy

New Relic Query Language (NRQL):

NRQL is New Relic’s SQL-like query language. You can use NRQL to retrieve detailed New Relic data and get insight into your applications, hosts, and business-important activity.

where can we use NRQL?

  • New Relic query builder Advanced mode in a query interface
  • New Relic query builder Basic mode provides a simplified query experience that doesn’t require knowledge of NRQL but that uses NRQL to generate results

Types of Data We can Query:

Event data from all New Relic products, including:

  • APM events, like Transaction
  • New Relic Browser events, like PageView
  • New Relic Mobile events, like Mobile
  • Infrastructure events, like ProcessSample
  • Custom events, like those reported by the Event API
  • Metric timeslice data (metrics reported by New Relic APM, Browser, and Mobile)
  • The Metric data type (metrics reported by the Metric API and data sources that use that API)

--

--