Skip to content

Jax-RS Transaction name gets overriden when calling another Jax-RS  #1062

@Theoderich

Description

@Theoderich

When the implementation of a JAX-RS service calls another Method that exposes a JAX-RS service, the name of the transaction is overriden to the name of the second method, obscuring the original call.

Steps to reproduce

Consider the following class:

import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;

@Path("/test")
public class TestRestService {

    @GET
    public void methodA(){
        doSomeStuff()
        methodB();
        doMoreStuff()
    }

    @POST
    public void methodB(){
        doMethodBStuff()
    }

}


when methodA is called via HTTP, the Transaction will be named "methodB" by APM. The call to methodA is obscured. This happens because calls to JAX-RS endpoint rename the transaction even if the method is not the entry point to the transaction.

Expected behavior

I would expec the APM-Transacton that gets traced when calling methodA via REST to be called "TestRestService#methodA" even if methodB is called inside the transaction.

Sugestion

in #748 a priority system for overriding transaction names was introduced, but names with the same NamePriority as the current name can still override the current name. Maybe this could be changed to only higher priority? Just a thought.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions