Discover the top benefits of observability
See the research

When you monitor the four golden signals—response time, throughput, error rate, and saturation—you can quickly see an overview of the health and performance of your application. These metrics were traditionally almost exclusively the domain of Ops, DevOps, or SREs. But what about the application developers—those who are ultimately responsible for the code that builds these services?

To understand how your own code is performing and to troubleshoot customer issues, you need rich context and observability solutions that showcase these golden metrics at the service and system levels, and all the way down to methods in the code. Code-level metrics and service-level telemetry give you the ability to see which services and lines of code are impacting your application.

Code-level metrics

The New Relic CodeStream IDE extension brings software performance into the daily practice of developers by providing a pervasive, always-on view of code-level metrics. The three golden metrics that are applicable to application services are displayed as a line of text, called a CodeLens, above each method in your code, automatically instrumented by the New Relic APM agent.

In this example, you can see the golden signals of response time, throughput, and error rate:

Screenshot of golden signals directly in an IDE

Select a CodeLens for a set of charts visualizing each of the metrics. You can also get more insight by clicking through to the APM service summary page in New Relic. 

More importantly, you can also change the service for the code-level metrics that you see. This allows you to see how your code is performing in other environments, such as staging or QA, so you can take a more proactive approach to performance problems. You can get ahead of these issues before they hit production.

Screenshot of changing the service for the code level metrics that you see in your IDE

Service-level telemetry

While seeing how the actual code is performing is arguably the most important thing for your day-to-day work, it’s also important to see the bigger picture. You might think about these questions:

  • The code I’m responsible for builds a particular service. How is that service performing?
  • How are the services that are related to mine performing?

Unless there’s an incident developers rarely see this view of the world.

The observability section of CodeStream changes this old approach. The golden metrics for the services associated with the repo you have open in your IDE are available at a glance. And with just one click, you can see the metrics for any service that calls, or is called by, your service.

In this screenshot, you can see an example of the response time, the throughput, and the error rate for a service, the services that it calls, and the services it is called by:

 

Screenshot of metrics for a service and the services that it calls and the services it is called by

With service-level telemetry, you get the big picture, right in your IDE.

CodeStream video walkthrough

For a quick walkthrough of these features, check out this Nerd Bytes video:

Getting started with code-level metrics is easy

Follow these instructions to get started. Note that code-level metrics are currently supported for Python, Ruby, .NET, and Go. Java support is in private preview, so reach out to us at codestream@newrelic.com if you’d like to participate. PHP and Node.js support are on the way!

1. Update your agent

Update your APM agent to the version that supports code-level metrics. 

  • .NET - Version 9.9.0 or later
  • Python - Version 7.10.0.175 or later
  • Ruby - Version 8.10.0 or later
  • Go - Version 3.18.0 or later

For .NET and Go you’ll also need to enable code-level metrics in the agent configuration.

2. Install the CodeStream extension

Install the CodeStream extension as you would any other extension for VS Code or a JetBrains IDE by going to the marketplace in your IDE. Make sure you’re running the latest version (v14.0 or later).

3. Sign up for CodeStream

After installing the extension, you’ll be prompted to create a CodeStream account, even if you’re already a New Relic user.

CodeStream offers several signup options, but we suggest that you select Sign up with New Relic. In one step, you’ll be signed up for CodeStream and connected to your New Relic account. You’ll be prompted to enter your New Relic User API Key.

4. Associate a repository with your APM service

Open a repository in your IDE that corresponds to an APM service where you’d like to see code-level metrics. If the repository isn’t already associated with the APM service, you’ll get a message in the Observability section of CodeStream prompting you to make this association. 

Screenshot of Observability section of CodeStream to associate a repo with a New Relic APM service

If you have multiple services that correspond to this repo (such as different services for different environments), you can make additional repo<>service associations on the Summary page for your APM service in New Relic. Go to the Repositories section in the bottom right.

5. Open a file and look for each CodeLens

Open a source file from your repository and look for the golden metrics in a CodeLens above each instrumented method.

Screenshot of golden signals directly in an IDE