# APM StartTransaction not working

**URL:** <https://discuss.elastic.co/t/apm-starttransaction-not-working/309343>\
**Category:** APM\
**Tags:** dotnet, language-clients\
**Created:** [July 11, 2022, 4:07pm UTC](https://discuss.elastic.co/t/apm-starttransaction-not-working/309343 "2022-07-11T16:07:33Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ruben\_Marinho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruben_marinho/32/105973_2.png) [@Ruben\_Marinho](https://discuss.elastic.co/u/Ruben_Marinho)\
**Post date:** [July 11, 2022, 4:07pm UTC](https://discuss.elastic.co/t/apm-starttransaction-not-working/309343/1 "2022-07-11T16:07:33Z")

</div>

**Kibana version** : v8.3.2

**APM Server version** : 8.3.2

Hi,

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:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/c/ac518c6a1f7795e244611a83f1aab4e6da4b186c.png)

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

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/a/3/a306da3f9aa06430a3723d78d0708a456450ad8f.png)

I'm using an elastic cloud installation.

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

Thanks.

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [July 11, 2022, 6:16pm UTC](https://discuss.elastic.co/t/apm-starttransaction-not-working/309343/2 "2022-07-11T18:16:12Z")

</div>

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](https://www.elastic.co/guide/en/apm/agent/dotnet/current/troubleshooting.html#collect-agent-logs) from when this happens?

---

<div class="post-metadata">

**Author:** ![Ruben\_Marinho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruben_marinho/32/105973_2.png) [@Ruben\_Marinho](https://discuss.elastic.co/u/Ruben_Marinho)\
**Post date:** [July 12, 2022, 9:27am UTC](https://discuss.elastic.co/t/apm-starttransaction-not-working/309343/3 "2022-07-12T09:27:04Z")

</div>

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:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/d/6dfa4805ce96acd5930aafb2fc8ef3888dffe984.png)

And the StartTransaction:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/c/4/c42426770a116d94eca8d802c3ff2e6fc571a3ca.png)

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.

- Could you maybe attach [logs on trace level](https://www.elastic.co/guide/en/apm/agent/dotnet/current/troubleshooting.html#collect-agent-logs) from when this happens?  
if I call StartTransaction I get this errors:  
 ![chrome_7cMaUMfgG6](https://us1.discourse-cdn.com/elastic/original/3X/0/d/0d5c6b6ec92d6229d3ace33d73c9647da8d407b8.png)  
In detail:  
 ![chrome_YUAH5dMfk3](https://us1.discourse-cdn.com/elastic/original/3X/0/9/09e19132fa16943599076cf7392d66689fd9280e.png)

Thanks for your help.

Best regards,  
Ruben Marinho

---

<div class="post-metadata">

**Author:** ![GregKalapos](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gregkalapos/32/37205_2.png) [@GregKalapos](https://discuss.elastic.co/u/GregKalapos)\
**Post date:** [July 12, 2022, 10:31am UTC](https://discuss.elastic.co/t/apm-starttransaction-not-working/309343/4 "2022-07-12T10:31:58Z")

</div>

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 `](https://www.elastic.co/guide/en/apm/agent/dotnet/current/config-supportability.html#config-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.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 2, 2022, 6:32am UTC](https://discuss.elastic.co/t/apm-starttransaction-not-working/309343/5 "2022-08-02T06:32:27Z")

</div>

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