Code-level metrics allow developers using the New Relic CodeStream extension to see APM data displayed contextually in their IDE, alongside individual methods in the code. This allows developers to be more proactive about addressing performance issues as they write and review code.
First, install the New Relic CodeStream extension into your supported IDE of choice and login.
Code-level metrics are available for Python agent version 126.96.36.199 and higher and are enabled by default. To change this configuration, check out our documentation.
The Python agent reports and attaches the following attributes to spans produced by your application:
The name of the instrumented function
The absolute path to the source code file in which
The line number where
The namespace (class/ module name) in which
Not every function in your application code will be instrumented with the above attributes. In some cases, the agent will directly wrap base framework code (ie. Django, Flask, etc.) that is invoked within your application and will not display within your IDE.