• /
  • EnglishEspañolFrançais日本語한국어Português
  • Inicia sesiónComenzar ahora

Code-level metrics

|View as Markdown (English)

Code-level metrics are span attributes that the Node.js agent attaches to your application's spans, pinpointing the exact function and file responsible for a given span. This allows you to be more proactive about addressing performance issues as you review your code. You can view these attributes on individual spans in distributed tracing, or query them directly with NRQL.

Importante

Code-level metrics are available for Node.js agent version 9.7.5 or higher, and enabled by default for version 10.5.0 and higher. To change this configuration, check out our documentation.

Agent attributes

The Node.js agent reports and attaches the following attributes to most spans produced by web frameworks in your application.

Importante

In some cases, the agent will directly wrap base framework code that's invoked within your application, and these attributes won't be attached.

Name

Description

Example

code.function

The name of the instrumented function. It will be (anonymous) for both anonymous and arrow functions.

routeHandler

code.filepath

The absolute path to the source code file where code.function is defined.

/usr/local/app/sample-node-app/index.js

code.lineno

The line number where code.function is defined in code.filepath.

639

code.lineno

The column number where code.function is defined in code.filepath.

47

Copyright © 2026 New Relic Inc.

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