• English日本語한국어
  • Log inStart now

Code-level metrics

CodeStream not only gives you a big-picture view of how the services built from your code are performing, but also provides insight into how the code itself is performing.

Anomaly detection

CodeStream automatically flags performance problems in your code, allowing you to proactively address performance issues as they arise.

CodeStream identifies performance issues by starting with transactions and looking for anomalies in either error rate or average duration. If you’re using New Relic’s change tracking to send deployment information, anomalies are calculated by comparing the performance since your last release against the preceding three weeks. Otherwise, we use the last seven days. For any transactions identified as having performance issues, CodeStream then drills down into the segments (e.g., database queries, external calls, individual methods, etc.) that make up the transaction to see if any of them are performing poorly. This allows you to hone in on the source of the problem.

CodeStream also lets you know about performance issues via desktop notifications in either VS Code or JetBrains IDEs.

In-editor performance data

Without having to seek it out, performance data is displayed contextually in the editor so that it can inform the work at hand. Say you’re working on a bug fix, and happen to notice that the area of the code you’re working in has an elevated error rate. Maybe you address that issue as part of your bug fix so that it doesn’t escalate into a bigger problem.

CodeStream shows the average duration and error rate, for the last 30 minutes, in a CodeLens above each method instrumented by the New Relic APM agents. Metrics are calculated for the service currently selected in the CodeStream pane. Expand a different service and the metrics update accordingly.

Click the CodeLens to see charts visualizing each of the metrics. If the repository is associated with multiple New Relic-monitored services, you can easily switch between them. This changes the service upon which the code-level metrics displayed in both the charts and the editor are based, and also change the service selection in the CodeStream pane.

Along with a chart of the error rate you’ll also see a list of the actual errors happening in the same timeframe, including the number of occurrences for each. If the error rate is spiking, and you see one particular error is causing the problem, you can click on it to view the stack trace and start collaborating on resolution.

Requirements

To see in-editor performance data, your service must meet the requirements listed below, and the service should have collected data in the last 30 minutes. The New Relic agent attempts to automatically collect data for functions on classes that are tied to HTTP requests. In many cases, and with many frameworks that use an MVC framework, these are often methods on a Controller class.

Because all requests by the New Relic agent are not collected all the time, it’s possible that low-traffic methods won't see any data. If data is missing for a specific method that you wish to see results for, you can use custom instrumentation to fill any gaps. See guidance for Java, .NET, PHP, Python, Ruby, Go and Node.js.

You can turn CodeLenses off by going to the CodeStream section of your IDE's settings and unchecking the CodeStream: Show Golden Signals In Editor setting.

Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.