Code-level metrics are span attributes that the PHP 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.
Important
Code-level metrics are available in the PHP agent version 10.4.0 or higher and disabled by default for all versions except for versions 10.6.0 - 11.10.0 where it is enabled by default. To change this configuration, check out our documentation.
Agent attributes
The PHP agent reports and attaches the following attributes to spans produced by your application:
Name | Description | Example |
|---|---|---|
| The name of the instrumented function | createProduct |
| The absolute path to the source code file in which | /symfony/symfony_app/src/Controller/ProductController.php |
| The line number where | 16 |
| The namespace (class/ module name) in which | App\Controller\ProductController |
Important
Code-level metrics are only supported for PHP version 7.0 or higher.