.net core 2.1 no Database statment in Stacktrace

I am trying to get Database statements from the APM Stacktrace as shown in Greg Kalapos video YouTube i am following the instructions in the video and on the github page 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",
"TransactionSampleRate": 1.0
}
}

Hi @marcus.labohm

Greg here from the video :slight_smile:

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 Core monitoring, the 2. turned on everything (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. 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

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

Hey Grey,

i finaly got some time to test this and it works like expected. :slight_smile:
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

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 :slight_smile:

Regards,
Greg

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