Elastic.Apm.AspNetFullFramework not showing database calls
See original GitHub issueOnly the HTTP calls are shown in Kibana in the Trace sample, there is nothing on database calls There is nothing in the documentation specific to database queries interception for the full .net framework - https://www.elastic.co/guide/en/apm/agent/dotnet/current/setup.html#setup-asp-net
Steps to reproduce the behavior:
- Create a new project ASP.NET Web Application (.NET Framework) with MVC and add the Elastic.Apm.AspNetFullFramework nugget (1.2)
- Web.config:
<appSettings>
<add key="ElasticApm:ServerUrls" value="http://IP.ADDR:8200/" />
</appSettings>
<modules>
<add name="ElasticApmModule" type="Elastic.Apm.AspNetFullFramework.ElasticApmModule, Elastic.Apm.AspNetFullFramework" />
</modules>
-
Execute any type of query using System.Data.SqlClient, for example
-
See the output in Kibana - only HTTP call is shown
Expected behavior Trace sample to include SQL calls as well.
Issue Analytics
- State:
- Created 4 years ago
- Comments:28 (15 by maintainers)
Top Results From Across the Web
Troubleshooting | APM .NET Agent Reference [1.x]
No data is sent to the APM Serveredit. If neither errors nor performance metrics are being sent to the APM Server, it's a...
Read more >Elastic APM auto instrumentation not capturing DB and http ...
I've created a test project with a .NET WCF service (Framework 4.7.1), I can see the ElasticAPM agent auto creates spans for WCF...
Read more >Common problems | APM User Guide [8.9]
Data is indexed but doesn't appear in the APM appedit ... The APM app relies on index mappings to query and display data....
Read more >Cannot make APM Client work on IIS
Hi Sergey, thanks for the quick answer. Adding the type "Elastic.Apm.AspNetFullFramework" fixed the problem. I'm not getting data in the server, ...
Read more >Auto instrumention - Metrics work, traces not received - APM
We want to trace all of our applications (built with OutSystems lowcode platform). So we used the auto instrumentation profiler for IIS 10.0 ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great! Then this is something that we almost already support.
So, there is no official NuGet package, but we have this project in the repo: https://github.com/elastic/apm-agent-dotnet/tree/master/src/Elastic.Apm.SqlClient
That is the auto instrumentation for
SqlClient
- meaning db calls will be automatically captured for you.If you clone the repo and build that project you can create an assembly from that.
That will give you a
SqlClientDiagnosticSubscriber()
class.After that, all you need to do is to execute this once, preferably during the startup of the application:
This way you can give it a try.
But please keep in mind this is not an officially released component yet.
The main reason it’s not yet released is because we don’t have a solution for scenarios when EF or EF Core is used with MSSql - in that case EF (Core) uses
SqlClient
internally, so db calls would be captured twice. Which in your case is not relevant, so that’s good.Once we have a solution for this problem, the plan is to have an official release of this package.
I totally agree with you. My mention was related to not retranslate my words on behalf of the owners.
So, this mention is related to the case, when you reference .net core
System.Net.Http
as a NuGet package in .Net Framework application. To be honest,DiagnosticsSource
is available for .Net Framework as a NuGet package. However, .Net Framework version ofSqlClient
, don’t spread trace events throughDiagnosticsSource
.