# .net core 2.1 no Database statment in Stacktrace

**URL:** <https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [August 30, 2019, 7:22am UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457 "2019-08-30T07:22:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcus.labohm](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@marcus.labohm](https://discuss.elastic.co/u/marcus.labohm)\
**Post date:** [August 30, 2019, 7:22am UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457/1 "2019-08-30T07:22:35Z")

</div>

I am trying to get Database statements from the APM Stacktrace as shown in Greg Kalapos video [YouTube](https://youtu.be/1EyF6JIST_0?t=462) i am following the instructions in the video and on the [github page](https://github.com/elastic/apm-agent-dotnet/blob/master/docs/configuration.asciidoc) but only see the http request in Kibana.  
screenshots attached

Do i need to configure the APM to send Database statements?  
Does the APM not work with other connectors besides microsofts entity framework core?  
If so, are there plans to expand the APM to work with other connectors?

I am using a localy hostest apm-server 6.6.0 with elasticsearch 6.6.0 and kibana 6.6.0,  
a .net core 2.1 MVC sample app created with Visual Studio 2019,  
the Elastic.Apm.NetCoreAll Version="1.0.1" NuGet  
and the Devart.Data.MySql.EFCore Version="8.12.1229" NuGet for the DB Connection since we are using a MariaDB (MySQL)

appsettings looks like this

> {  
> "Logging": {  
> "LogLevel": {  
> "Default": "Warning"  
> }  
> },  
> "AllowedHosts": "\*",  
> "ElasticApm": {  
> "LogLevel": "Warning",  
> "ServerUrls": "[http://127.0.0.1:8200](http://127.0.0.1:8200)",  
> "TransactionSampleRate": 1.0  
> }  
> }

 ![Kibana1](https://us1.discourse-cdn.com/elastic/original/3X/9/f/9feb1094375a9f250499b5e879fb2331123c1a85.png) ![Kibana2](https://us1.discourse-cdn.com/elastic/original/3X/b/7/b7af60fa4ed644816720b150398b25299d50361b.png)

---

<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:** [August 30, 2019, 8:33am UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457/2 "2019-08-30T08:33:33Z")

</div>

Hi @marcus.labohm

Greg here from the video 🙂

> Do i need to configure the APM to send Database statements?

In case you turn on the agent with the `UseAllElasticApm` method from `Elastic.Apm.NetCoreAll ` you don’t need to configure database monitoring, we turn on everything for you. Now 1 reason you don’t see database calls can be related to this. Back in the alpha and pre-release days (that’s when the video you referenced was created) we had the `UseElasticApm` both in the `Elastic.Apm.AspNetCore` and also in the `Elastic.Apm.All` namespace. The 1. only turned on [ASP.NET](http://ASP.NET) Core monitoring, the 2. turned on everything ([ASP.NET](http://ASP.NET) Core, outgoing HTTP tracing, and database tracing, etc.) It turned out that having the same method name is very confusing so we made a change: Now there is the `Elastic.Apm.NetCoreAll` package with the `Elastic.Apm.NetCoreAll` (previously `Elastic.Apm.All`) namespace and it has a `UseAllElasticApm` method - an example usage can be seen [here](https://github.com/elastic/apm-agent-dotnet/blob/master/sample/SampleAspNetCoreApp/Startup.cs#L53). Hopefully this naming is more clear: this is the one that turns on everything (including db monitoring). So my 1. idea: Do you use this method - (so `UseAllElasticApm` from `Elastic.Apm.NetCoreAll`)? If not please make sure you switch to this.

> Does the APM not work with other connectors besides microsofts entity framework core?

We target EF Core and we listen to events that are sent by EF Core itself, the connector should not matter. On the other hand we only tested with SQLite and MS SQL. In theory all connectors should work, because the events we use are not related to the connectors. If this is not the case I’m happy to look into a specific setup and figure out why it does not work.

> If so, are there plans to expand the APM to work with other connectors?

In case it does not work, I’d take a look at it - In case you have a reproducer that I can just start that would be super helpful.

But first let’s see if it really does not work.

Hope this helps,

Greg

---

<div class="post-metadata">

**Author:** ![marcus.labohm](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@marcus.labohm](https://discuss.elastic.co/u/marcus.labohm)\
**Post date:** [August 30, 2019, 1:46pm UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457/3 "2019-08-30T13:46:09Z")

</div>

Hey Greg,

thx for the fast reply. You were right i did use the "UseElasticApm" Method in my code.  
As soon as i have time to test this, i'll come back with a response about the DevArt dotConnector question.

Kind regards  
Marcus

---

<div class="post-metadata">

**Author:** ![marcus.labohm](https://avatars.discourse-cdn.com/v4/letter/m/4af34b/32.png) [@marcus.labohm](https://discuss.elastic.co/u/marcus.labohm)\
**Post date:** [September 2, 2019, 10:56am UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457/4 "2019-09-02T10:56:00Z")

</div>

Hey Grey,

i finaly got some time to test this and it works like expected. 🙂  
So with the UseAllElasicApm method i am able to get the Databse statements from the DevArt dotConnector connecting to the Maria DB.

Kind regards  
Marcus

---

<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:** [September 2, 2019, 12:47pm UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457/5 "2019-09-02T12:47:25Z")

</div>

Thanks for the update, sounds good!

Sorry for the confusion caused by the video. It was done back in the alpha days, and some things changed since then. Maybe it's time for a new video 🙂

Regards,  
Greg

---

<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:** [September 23, 2019, 8:47am UTC](https://discuss.elastic.co/t/net-core-2-1-no-database-statment-in-stacktrace/197457/6 "2019-09-23T08:47:38Z")

</div>

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