APM StartTransaction not working

Kibana version: v8.3.2

APM Server version: 8.3.2


I have a .net project that is using a really old Elastic.APM dll (version 1.2.0).
In this version, I was able to create transactions "manually" with a name and type defined by me.
But after the upgrade of DLL to the APM new version (1.16.1) the transaction isn't created anymore.

In the .net code, the transaction is created using:
_transaction = Agent.Tracer.StartTransaction(ssTransactionName, ssTransactionType);

Another issue that I noticed after the upgrade is that "Metrics" is not available on APM UI anymore. So I can have access to CPU and memory utilization:

There are no errors in the logs and other information are been collected:

I'm using an elastic cloud installation.

Any clue why this is happening for the new version? Am I missing something here?


Hi @Ruben_Marinho,

there wasn't any change in newer versions that'd need further manual steps.

The only thing that changed is how agent initialization works, but that should not really effect you.

I'd need some more info in order to help.

So, a few questions:

  • What kind of application do you have? (Console app, .NET Core, .NET Framework, Web App, or something else?)
  • How do you turn on the agent? So how did you add it to the application?
  • Could you maybe attach logs on trace level from when this happens?

Hi Greg,

Answering your bullets:

  • What kind of application do you have? (Console app, .NET Core, .NET Framework, Web App, or something else?)
  • It's a "Class Library" using ".Net Framework 4.7.2.". This class is used as an Outsystems extension.
  • How do you turn on the agent? So how did you add it to the application?
    In the code, the agent setup is done like this:

And the StartTransaction:

In my app, I start by invoking the function MssInitialize and in some button clicks, I invoke the MssStartTransaction to create a new transaction.
These clicks invoke a query and because of these server actions, I expected to see some metrics of CPU/memory usage. But that information doesn't appear anymore on APM UI.

Thanks for your help.

Best regards,
Ruben Marinho

Unfortunately I still don't see what the issue is.

Could you maybe attach a full agent log on Trace level? You can set ELASTIC_APM_LOG_LEVEL to trace and the agent will log more.

The NullReferenceException is definitely a useful pointer, but it's not enough. If there is a stacktrace on it, that'd help as well - but better would be a complete agent log on trace level.

I see how you start the transaction, a few questions to that:

  • Are those calls successful? Do you get back a real ITransaction instance? Or do those call return null?
  • You also stop those as well, right? (I guess you do, I'm asking just to be on the safe side, because I don't see calling ITransaction.End() on the screenshot).

The fact that you don't see metrics either is also a useful info, but without more logs I can't really see what's the issue is. With a full agent log we can maybe connect the two issues.

And one last idea: if you referenced an Elastic.Apm.* package in multiple libraries, please make sure all Elastic.Apm.* packages are on the same version (same minor and same patch level). We had some issues on this - I know this is not a very good update experience and we already look at how we can avoid this - but for now, all Elastic.Apm.* packages should be at the same version.

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