'NewRelic monitoring for Spring Boot application not tracking endpoints correctly

We have a Spring boot (v1.3.8) based application being monitored by New Relic APM, which uses projects like Spring Data & Spring Data Rest. New Relic configured as an agentlib.

In this applciation, we have certain endpoints like

/Employee/12345
/Employee/search/findEmployeesByDeptId?DeptId=12345

This end-point is bound to a Spring Data based "CRUDRepository".

The problem I have is that under New Relic, when it reports long running transactions, It aggregates all of those endpoints to one of the below

/RepositoryEntityController/getCollectionResource
/RepositoryEntityController/getItemResource
/RepositorySearchController/executeSearch

Is there a tweak such that the above aggregation reports some meaningful URLs rather than the above programs?



Solution 1:[1]

By default the New Relic agent will use the Controller name plus the method as the transaction name.

You could try disabling auto transaction naming and see if the result works for you. Note the warning on that page.

Another way would be to use the Java agent API. Though in this case you'd need to add a line of code to each of your endpoints. Or do some wizardry in your servlet.

// see https://newrelic.github.io/java-agent-api/javadoc/index.html?com/newrelic/api/agent/NewRelic.html
NewRelic.setTransactionName("/Employee/" + employeeId);

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 André Onuki