• Log inStart now

CodeStream and New Relic

CodeStream and the New Relic platform work together to give you insight into your code's errors, as well as making it easier to get started instrumenting your code with our APM agents.

With CodeStream connected to New Relic, you can jump from a stack trace error directly to the offending line of code in your IDE. Once in your IDE, you can navigate the stack trace and collaborate with your teammates to resolve the issue.

Connect CodeStream and New Relic

Before you can take advantage of New Relic's observability features in CodeStream, you'll need to connect them.

Requirements for connecting CodeStream and New Relic:

Once you have your New Relic user key, in CodeStream's Observability section click Connect to New Relic, then paste your API key and click Connect to New Relic.


New Relic users can share stacktrace errors on CodeStream. Once you've connected CodeStream to New Relic, any new users you add to your CodeStream organization can see those errors.

See your errors and what's causing them

After you connect CodeStream and New Relic, use workloads and errors inbox to jump to the offending code in your IDE.

Requirements for opening stack trace errors in your IDE:

New Relic errors inbox is a single place to proactively detect, prioritize, and take action on your errors before they impact customers. With CodeStream, you can jump from an error directly to the offending code in your IDE.


Limited to APM errors.

How to go from errors inbox to your IDE

From one.newrelic.com/, go to Errors Inbox, click a stack trace error, then click Open in IDE.

APM errors and CodeStream

In order to view stack trace errors in your IDE, CodeStream needs to know what repository the error is associated with and, ideally, which version of the code generated the error.

Associate repositories with errors

Once you've started monitoring for APM, mobile, or browser, you should create repository entities and associate them with entities for all of your services. In order to create a repository entity you'll need to provide the repository's remote URL. For example, the remote URL can be in either the SSH or HTTPS format:

  • git@github.com:newrelic/beta-docs-site.git
  • https://github.com/newrelic/beta-docs-site.git


It's possible to add the same GitHub repository more than once, if you're using different protocols to do so. The UI warns you about this, but won't prevent you from doing so.

For example, https://github.com/tuna/repo and git@github.com:tuna/repo are the same repo, with different protocols.

If you try to open an error in your IDE and there isn't an associated repository, CodeStream will prompt you to make an association and save that association for all errors from the given entity on New Relic. However, it would be preferably to use one of the following methods since they require less ongoing manual effort and eliminate the possibility of end-user mistakes, such as misconfigured remote URLs.

Associate build SHAs or release tags with errors

To use CodeStream's Open in IDE with your APM stack trace errors, use environment variables to configure your APM agent with your application's commit sha and/or your release tag associated with the running version of your software.

CodeStream only needs the first seven characters of your commit sha (for example, 734713b) to make this connection, but you can include the entire sha.

Alternately, you can use a release tag (such as v0.1.209 or release-209) for CodeStream to find the correct version of your code.

For New Relic APM, the commit and/or release tag (tags.commit and tags.releaseTag) are added as attributes on Transaction and TransactionError events. You can use APM environment variables to set these attributes.

We recommend setting one or both of these variables as part of your build pipeline.

  • NEW_RELIC_METADATA_COMMIT - The commit sha. You can include the whole thing or only the first seven characters.
  • NEW_RELIC_METADATA_RELEASE_TAG - A release tag (such as v0.1.209 or release-209). This has the advantage of being human readable.

For more on how to set these variables, here are specific configuration details for each language:

Install APM agents with CodeStream

Requirements for installing New Relic APM agents via CodeStream:

When you first connect CodeStream to New Relic, if you're working on an application's codebase that's not being monitored by New Relic, CodeStream will offer to instrument that application for you.

Like New Relic's guided install, CodeStream will walk you through and automate all of the steps to installing the APM agent to start sending data to New Relic.

This check only happens automatically when the initial connection is made. To do so later, in the CodeStream extension, click your username, then click New Relic Setup.

Dynamic logging with Go and Pixie

Code-level metrics with Python and Ruby

You can use CodeStream and New Relic to instrument your Python or Ruby application code performance. Once enabled, metrics are shown as a CodeLens, or text inserted above your code's methods, in your IDE.

Copyright © 2022 New Relic Inc.