New OpenTracing Features in Payara Platform 5.194

Payara

Payara Platform has implemented MicroProfile OpenTracing with its own tracer that can be sent to other sources via the notification service. But maybe you don’t want to use Payara’s Tracer, and instead want to use a different one – now you can, starting from Payara Platform 5.194 onwards.

If you wish to use an alternative tracer, you must deploy it as a library to Payara with a file META-INF/services/io.opentracing.Tracer that lists the class name of the tracer to use.

Jaeger Tracing Example

As an example, if you wish to use the Jaeger Tracer you will need a wrapper for it – one is provided at https://github.com/payara/ecosystem-jaeger-tracing. Build the project with mvn clean install and then deploy the complete artifact with asadmin add-library jaeger-tracer-lib-jar-with-dependencies.jar. The JaegerTracerWrapper.java class shows how it is configured.

Configuration.SamplerConfiguration samplerConfig =Configuration.SamplerConfiguration.fromEnv().withType(ConstSampler.TYPE).withParam(1);
Configuration configuration =Configuration.fromEnv("jaeger-test").withSampler(samplerConfig);

This will create a tracer that will trace every request using the name “jaeger-test” when in the Jaeger tracer UI and will send it to a Jaeger collector on the same host (this is the Jaeger default).

Tracing must then be enabled in Payara Server, this can be done with the following asadmin commands:

set-requesttracing-configuration --enabled=true --dynamic=true

bootstrap-requesttracing

To view the results of the trace, a Jaeger  collector must available. One can be started easily using docker as follows.

docker run --rm -p 6831:6831/udp -p 6832:6832/udp -p 16686:16686 jaegertracing/all-in-one --log-level=debug

The Jaeger UI is now available on port 16686 on the same host. Going to it will list the available traces, which are under the service name of “jaeger-test” in this example.

 

Screenshot at 2019-11-18 10-49-00

 

Here you can compare traces or get more details of an individual trace. So in this example, it is obvious that one request took a lot longer than anything else. Clicking on it to find out the details shows:

Screenshot at 2019-11-18 11-00-58

 

In this case, what took longer was creating a new instance. The other requests came from simple servlets.

Use the tracer of your choice starting with Payara Platform 5.194.

Try it Out! Download Payara Platform 5.194

{{cta(‘b2e4c2b6-f33a-4ae4-9290-f1cf476f445a’)}}

 

 

 

 

Comments (2)

Post a comment

Your email address will not be published. Required fields are marked *

Payara needs the contact information you provide to us to contact you about our products and services. You may unsubscribe from these communications at any time. For information on how to unsubscribe, as well as our privacy practices and commitment to protecting your privacy, please review our Legal & Privacy Policy.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Joel Martins

    Hi,
    Great article and excellent examples. I managed to integrate jaeger with micro payara in docker, but I only have one question, so I didn’t get the logs sent by payara via stdout to the docker.
    This is normal, is there a way to keep the logs along with the jaeger integration?

  2. Jadon Ortlepp

    Hi Joel, I spoke with some of the team and if you are referring specifically to the OpenTracing logs – no. You either get the logs or Jaeger, you can’t currently have both unfortunately.

Related Posts

End of Life and End of Support Software 3 minutes
Migration

End-of-Life Technology: How to Drive Innovation Without Compromising Stability

When legacy systems approach end-of-life (EOL), enterprise IT teams typically face the choice of moving forward at all costs […]

Payara promotional graphic for Jakarta Data, featuring and illustrated server stack labeled Core, Web, Full Platform. 3 minutes
Community

Jakarta Data Makes Persistence a Breeze 

Working with enterprise Java databases can sometimes feel like swimming upstream. Jakarta EE 11’s Jakarta Data helps developers glide […]

What's New In The Payara Platform August 2025 Release? 5 minutes
Community

What’s New In The Payara Platform November 2025 Release?

The November 2025 release brings significant milestones across the Payara Platform family. This month includes Payara Platform Community 6.2025.11, […]