# APM Problems with Entity Framework 5 DB Transactions

**URL:** <https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [February 15, 2023, 7:57am UTC](https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555 "2023-02-15T07:57:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Klauck](https://avatars.discourse-cdn.com/v4/letter/k/dec6dc/32.png) [@Klauck](https://discuss.elastic.co/u/Klauck)\
**Post date:** [February 15, 2023, 7:57am UTC](https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555/1 "2023-02-15T07:57:48Z")

</div>

I have an APM:7.13.1 setup and using it sucessfully with nodejs. In my [asp.net](http://asp.net) core with entitiy framework 5 solutions I'm am facing a small issue that I'm not seeing the transaction start and commit or rollback.  
I tried two different versions of creating the transactions:  
1.)

```auto
using (var scope = new TransactionScope(TransactionScopeAsyncFlowOption.Enabled))
{
     // some db calls here
}

```

2.)

```auto
var trans = dbContext.Database.BeginTransaction();
// some db calls here
trans.Commit();

```

Unfortunatly in both I'm not getting the trace but I see all my DB requests.

Best  
Martin

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [February 15, 2023, 9:53am UTC](https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555/2 "2023-02-15T09:53:12Z")

</div>

Hi @Klauck,

could you elaborate on "not getting the trace but I see all my DB requests"?  
What do you mean by trace/DB requests here? Do see any data in Kibana?  
Thanks for clarifying.

Cheers  
Wolfgang

---

<div class="post-metadata">

**Author:** ![Klauck](https://avatars.discourse-cdn.com/v4/letter/k/dec6dc/32.png) [@Klauck](https://discuss.elastic.co/u/Klauck)\
**Post date:** [February 15, 2023, 10:17am UTC](https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555/3 "2023-02-15T10:17:45Z")

</div>

Hi Wolfgang,

I do see data in Kibana .. all sql queries and also all requests going out.  
What I'm missing is the instrumentation of the transaction as I see them in nodejs.  
e.g: START transactinon & SET isolationLevel.  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/0/2071c2f69b79d676f0ae9e2eba0d0c4cc0c37da7.png)

In my dotnet solutions is is simply skipping this information from the apm logs (in kibana)  
I see as example this (missing the stat ransaction and the commit:  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/3/f/3f7b382dea691893dba944ebe9d9e3f1e8167bce.png)

But Maybe this is an entity framework issue/thing!?  
I'm using TransactionScope(TransactionScopeAsyncFlowOption.Enabled) but had the same issue when I created the transaction via dbContext.Database....

Best

Martin

---

<div class="post-metadata">

**Author:** ![Wolfgang\_Ziegler](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wolfgang_ziegler/32/109929_2.png) [@Wolfgang\_Ziegler](https://discuss.elastic.co/u/Wolfgang_Ziegler)\
**Post date:** [February 16, 2023, 8:09am UTC](https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555/4 "2023-02-16T08:09:12Z")

</div>

Hi @Klauck,

unfortunately, our agent does not instrument these parts of EF.  
If you are interested in this functionality being implemented, please [open an issue](https://github.com/elastic/apm-agent-dotnet/issues/new/choose) in our GitHub repository.

Thanks  
Wolfgang

---

<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:** [March 9, 2023, 4:09am UTC](https://discuss.elastic.co/t/apm-problems-with-entity-framework-5-db-transactions/325555/5 "2023-03-09T04:09:37Z")

</div>

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