---
title: Java agent class transformer settings
source: https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-class-transformer-settings
---

Class transformer settings control which built-in instrumentation modules are enabled and how the agent transforms classes at load time.

> #### 💡 TIP
>
> Back to the full settings index: [Java agent configuration](https://docs.newrelic.com/docs/apm/agents/java-agent/configuration/java-agent-configuration-config-file)

## Class transformer [#Class_Transformer]

Set instrumentation related settings in the `class_transformer` section. You can override these settings with a `newrelic.config.class_transformer` prefixed [system property](#System_Properties) or a `NEW_RELIC_CLASS_TRANSFORMER_` prefixed [environment variable](#Environment_Variables).

**enhanced_spring_transaction_naming**

| Type    | Boolean |
| ------- | ------- |
| Default | False   |

When enabled, enhanced Spring transaction naming will name any transaction that originates from a Spring controller after the defined route and HTTP method. For example: `/customer/v1/edit (POST)`. This includes controllers that implement or extend interfaces/classes with WebMVC related annotations (`@RestController`, `@Controller`, `@RequestMapping`, etc).

By default, this is configured to `false`, which will name transactions for those types of controllers based on the controller class name and method. For example; `CustomerController/edit`. This is the naming logic carried over from previous agent versions. "Standard" controllers, with all relevant annotations present on the actual class, will still get named based on route and HTTP method.

This config exists in Java agent version 8.9.0+.

**use_controller_class_and_method_for_spring_transaction_naming**

| Type    | Boolean |
| ------- | ------- |
| Default | False   |

When enabled, all Spring Controller transactions will be named using the controller class name and method name (e.g., `/CustomerController/edit`) instead of using request mappings (e.g., `/api/v1/customer (POST)`).

This setting takes precedence over `enhanced_spring_transaction_naming` and helps prevent transaction name cardinality issues with complex URI patterns.

Applies to Spring 4.3.x+ (spring-4.3.0 module) and Spring 6.x+ (spring-6.0.0 module).

This config exists in Java agent version 8.25.0+.

**name_actuator_endpoints**

| Type    | Boolean |
| ------- | ------- |
| Default | False   |

By default, built-in actuator endpoints and custom actuator endpoints (using the `@endpoint` annotation and its subclasses) will all be named as `OperationHandler/handle` in New Relic. Enabling this
setting will result in the transaction name reflecting the actual base actuator endpoint URI. For example, invoking `/actuator/loggers` or `actuator/loggers/com.newrelic` will result in the
transaction name `actuator/loggers (GET)`. This is to prevent MGI.

Supported when using Spring Boot v3 and later.

This config exists in Java agent version 8.15.0+.

**trace_annotation_class_name**

| Type    | String |
| ------- | ------ |
| Default | (none) |

String containing the full class name of the annotation class the agent uses to determine which user-specified methods to instrument. For more information about custom annotations, see [Java custom metric collection](https://docs.newrelic.com/docs/java/java-custom-metric-collection).

**com.newrelic.instrumentation.servlet-user**

| Type    | Boolean |
| ------- | ------- |
| Default | `false` |

Enable this option to capture the `userPrincipal` name. This name is included as a transaction trace attribute (with attribute names `user` and `enduser.id`), and [can be queried](https://docs.newrelic.com/docs/query-your-data/explore-query-data/explore-data/introduction-querying-new-relic-data). This also allows you to see in [errors inbox how many users are impacted by an error group](https://docs.newrelic.com/docs/errors-inbox/error-users-impacted/).

## Instrumentation

These options are set in the `instrumentation` stanza and can be overridden by using a `newrelic.config.instrumentation` prefixed system property.

**trace_lambda.enabled**

| Type    | Boolean |
| ------- | ------- |
| Default | false   |

By default, [@TraceLambda](https://docs.newrelic.com/docs/apm/agents/java-agent/api-guides/java-agent-api-instrument-using-annotation/#tracelambda) annotations are disabled. To use the annotation functionality for tracing lambda methods you must explicitly enable the feature as follows:

You can configure this via YAML:

````yml
instrumentation:
  trace_lambda:
    enabled: true
```

You can also use the system property `newrelic.config.instrumentation.trace_lambda.enabled=true` or the environment variable `NEW_RELIC_INSTRUMENTATION_TRACE_LAMBDA_ENABLED`.

````
