-
Notifications
You must be signed in to change notification settings - Fork 147
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate Spring instrumentations from javax to jakarta to fix transaction names in Spring 6 / Spring Boot 3 #1523
Comments
@mgr32 Our ultimate goal is to get rid of the legacy pointcut instrumentation and replace it with instrumentation modules, so we'll probably tackle this issue with an eye towards that. Thanks again! |
The team has decided to go ahead and patch the existing pointcut implementation (#1544) in order to get the immediate need addressed. An instrumentation module will be explored in the future. |
Hi all, may I know if the team has planned when this fix will be generally available? |
@blackr1234 We are currently testing the changes via #1544. The hope is to have it out in the next release (~ Oct 19th) but that can change if we run into any issues. |
@jtduffy Hello, are you able to share the schedule for the next release? It seems that the latest release is still |
Hi @m-joon-ixix |
@mgr32 Since you were so proactive in opening this issue regarding Spring controller naming, I (and the team) were wondering if you would be willing to do a smoke test of a new Spring controller instrumentation module that supports annotated controller interfaces and controller inheritance (in a lower environment of course). I've done some pretty exhaustive testing, but it would be nice to get some feedback from end users as well. If so, I can give you the branch name if you'd like to build the artifact on your own, or I can build a snapshot and forward you the link. Thanks! |
@jtduffy Sure, I can check the cases I prepared for reproducing this issue, please send me a link to the snapshot. |
@mgr32 I will have a link for you tomorrow or Thursday. I have one more change I want to add. Thanks again. |
Hi @jtduffy, please find the results below - everything looks fine, and some cases (in bold) have improved. Also, I noticed that the current version of New Relic Java Agent (8.7.0) assigns wrong transaction names again on Spring Boot 3.2 - fortunately the snapshot version fixes it, so I'm looking forward to the release 🤞 Thanks! Updated code used for testing can be found at https://github.com/mgr32/newrelic-spring-cloud-openfeign-issue/tree/springpointcut-sb3 Spring Boot 3.1.6
Spring Boot 3.2.0
|
@mgr32 We truly appreciate you taking the time to verify the transaction name changes. I think we're targeting the next release for a mid-February date, but I'll keep you updated. Thanks again! |
Hi @mgr32
|
Hi @jtduffy , I see you commented here recently, so trying to reach out here. Let me know if I should open a new ticket. I'm using the use case mentioned here https://github.com/newrelic/newrelic-java-agent/pull/1675/files#diff-e4198bccc8b26ce850fad44652bc4d489a6037ea28c29689b5641936648cd396R21 (Interface with @RequestMapping annoted methods, as generated by the open api generator, and implemented in its own Controller class). But still no instrumentation, only dispatcherServlet showing. Whereas before, we had proper naming. Agent: 8.8.1 @Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
@Validated
public interface AbcApi {
@RequestMapping(
method = RequestMethod.POST,
value = "/abc/def",
produces = { "application/json" },
consumes = { "application/json" }
)
default ResponseEntity<...> createDef(
@Valid @RequestBody Object def
) {
return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
}
} @MyCustomAnnotationAnnotatedWithRestController
public class MyController implements AbcApi {
@Override
...
} |
These changes I mentioned here haven't been released yet. They will be out in v8.9.0, which should be released within the next 3 weeks. |
Ah. Sorry for the misunderstanding. Thanks. |
@pintomau No problem. This is a snapshot build that contains an earlier version of the instrumentation changes if you'd like to give it a go in a lower environment. This jar doesn't have the feature flag so the new transaction names happen automatically. |
Description
After fixing #1197, in Spring Boot 3 applications transactions for "standard" controllers annotated with
@RestController
/@Controller
are named correctly (e.g.WebTransaction/SpringController/hello (GET)
), but other requests are still getting non-meaningful names (WebTransaction/Servlet/dispatcherServlet
), e.g. for:@RestController
-like annotations, e.g./actuator/health
(see Actuator endpoints),@RestController
directly (e.g. using custom annotations - see below for an example),This is because SpringPointCut instrumentation (and possibly other instrumentations - see https://github.com/newrelic/newrelic-java-agent/pull/1505/files) still relies on
javax
instead ofjakarta
packages. The following table sums up the observed cases:@RestController
/ unsecured@RestController
/ unsecured@RestController
/ secured / valid auth@RestController
/ secured / valid auth@RestController
/ secured / invalid auth@RestController
/ secured / invalid auth/hello-custom
is configured in the following way:/actuator-health
is configured automatically due to the presence ofspring-boot-starter-actuator
.Expected Behavior
Transaction names should include controller and method name whenever possible.
Steps to Reproduce
Described at https://github.com/mgr32/newrelic-spring-cloud-openfeign-issue/tree/springpointcut-sb3.
Your Environment
The text was updated successfully, but these errors were encountered: