Elastic cloud with APM monitoring Weblogic java application

We are doing a proof of concept with elastic APM to monitor a weblogic server with java 8. It runs a java enterprise application.

We have set it up with the elastic-apm-agent-1.36.0.jar as a startup parameter to weblogic. It has managed to connect with the cloud and is collecting some data, such as cpu usage, web transactions etc from weblogic. However non of the annotated methods show up in the collected data.

We have tried to put @CaptureTransaction and also @Traced on some different methods in our code and according to the documentation we should just set the application_packages configuration to the root package of our code.



java code:

package com.swisslog.wm6.customer.impl.yard;

public class YardManagementMdb extends AbstractMdb {

on one method:

@CaptureTransaction(type = "MDB")
protected void processMdbMessage(Message message)...

When looking at APM we do not find any transaction for type MDB.

We also tried using @Traced and it did not help either.

In addition we also tried to create a elasticapm.properties file with the same configuration into the same folder as the elastic-apm-agent-1.36.0.jar. This file seems to be read properly and any configuration changes there are reflected when restarting weblogic. However we are still not getting any transactions of type MDB captured.

Anyone know what we could be missing?

HI @Fr3ddy ,

Could you please provide us the apm agent logs at debug level? This will help us find the cause of your issues.

Based on your explanations I would guess that maybe processMdbMessage is called from inside an existing (e.g. JMS) transaction? In that case you should use @Traced to capture a span for processMdbMessage. It will however never appear as a transaction if it is called from inside an existing transaction.

You could add the following snippet to your processMdbMessage method:

ElasticApm.currentTransaction().setName("process Mdb Message")

This will allow you to rename the currently active transaction, so that you can more easily find it in the UI and treat it separately from other JMS transactions.

1 Like

It seems like you are correct. the JMS transactions behind our MDB causes the @Traced(type="MDB") to just use the existing span from the JMS transaction.

So when looking in APM in the list of types, the type named MDB is empty of any transactions.

I also tried with @Traced in another part of the code where we have a incomingWebRequest starting the transaction and we run into the same "issue" there where the type parameter is ignored.

It feels like it is difficult to instrument a java application with APM this way. Is there any document "best practice" for this out there?


You can also alter the type of the currently active Transaction from within your application code:


The @Traced annotation is actually not required in your case, unless you want the method call to processMdbMessage to appear as a span within your traces.

Is it the elastic agent automatically traceing all the java transactions in the application automatically?
Reading the documentation when it refered to transactions I just assumed it meant "elastic" transactions so I expected to have to use the annotations in order to collect any data.

I will try this setType("MDB") in my application and see if it does the trick :slight_smile:

Within APM we use the term "transaction" for the first span within a service for a trace. You can read more about it here.

Is it the elastic agent automatically traceing all the java transactions in the application automatically

Yes, at least for the supported frameworks.

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.