• /
  • Log in
  • Free account

CodeStream and New Relic One

CodeStream and New Relic One 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 One, 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.

Preview release

CodeStream's integration with New Relic One is a preview release limited to New Relic One accounts on our US data center, and your use is subject to the pre-release policy. (This does not apply to all other CodeStream functionality.)

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:

If you don't have a user key or want to learn more about how you can use and manage them, see our doc on the New Relic user key.

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

Caution

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.

Tip

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, browser, or Lambda, 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

Caution

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

For more help

If you need more help, check out these support and learning resources:

Create issueEdit page
Copyright © 2021 New Relic Inc.