Skip to content

Missing jaxrs span in Open Liberty  #7870

Closed
@fmhwong

Description

@fmhwong

Describe the bug
Running a simple JAX-RS application in both WebSphere Application Server traditional and Open Liberty with the latest version of Agent.

I got 3 spans from WebSphere Application Server traditional version 9.0.5.12 on Java 8.

  1. HTTP GET /properties
  2. JAX-RS getProperties()
  3. @WithSpan SystemResources.sleep()

However, I got 2 spans from Open Liberty version 23.0.0.1 on Java 11.

  1. HTTP GET /properties
  2. @WithSpan SystemResources.sleep()

The JAX-RS span is missing from Open Liberty.

Steps to reproduce

import java.util.Random;

import javax.enterprise.context.RequestScoped;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

import io.opentelemetry.instrumentation.annotations.WithSpan;

@RequestScoped
@Path("/properties")
public class SystemResource {

    private static Random rand = new Random(); 
    
    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Response getProperties() throws InterruptedException {
        sleep(rand.nextInt(500));
        return Response.ok(System.getProperties()).build();
    }

    @WithSpan
    private static void sleep(long ms) throws InterruptedException {
        Thread.sleep(ms);
    }
}

What did you expect to see?
Three spans should be created from Open Liberty.

What did you see instead?
Only two spans were created as described above.

What version are you using?
opentelemetry-javaagent version 1.23.0

Environment
Compiler: OpenJDK 11.0.11
OS: MacOS
Runtime (if different from JDK above): OpenJDK 11.0.17
OS (if different from OS compiled on): Ubuntu 20.04.5 LTS (Focal Fossa) in a container

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions