# No SQL tracing when using dapper in .Net 5

**URL:** <https://discuss.elastic.co/t/no-sql-tracing-when-using-dapper-in-net-5/255032>\
**Category:** APM\
**Tags:** dotnet\
**Created:** [November 11, 2020, 9:46am UTC](https://discuss.elastic.co/t/no-sql-tracing-when-using-dapper-in-net-5/255032 "2020-11-11T09:46:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![poserdonut](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/poserdonut/32/62693_2.png) [@poserdonut](https://discuss.elastic.co/u/poserdonut)\
**Post date:** [November 11, 2020, 9:46am UTC](https://discuss.elastic.co/t/no-sql-tracing-when-using-dapper-in-net-5/255032/1 "2020-11-11T09:46:54Z")

</div>

**APM Agent language and version** :  
C# 1.6.1

```
<PackageReference Include="Elastic.Apm.AspNetCore" Version="1.6.1" />
<PackageReference Include="Elastic.Apm.NetCoreAll" Version="1.6.1" />
<PackageReference Include="Elastic.Apm.SqlClient" Version="1.6.1" />

```

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**:  
Nuget

Hi!

We have a Web API which uses Dapper for data access. However we get no tracing for the SQL call. We are running .Net 5.0

In the Configure method in Startup.cs

```auto
    app.UseElasticApm(Configuration, new SqlClientDiagnosticSubscriber(), new HttpDiagnosticsSubscriber());

```

The code which calls the database looks like this

```auto
    using IDbConnection db = new SqlConnection(_configuration.InsuranceConnection());

    const string getAllaArbetsgivareIdnProcName = "[dbo].[Stored_Procedure]";

    var allaArbetsgivareId = await db.QueryAsync<Guid>(getAllaArbetsgivareIdnProcName, null, commandType: CommandType.StoredProcedure);

```

And it's using

```
using Microsoft.Data.SqlClient;

```

Logs from the application

> **[Ubuntu Pastebin](https://pastebin.ubuntu.com/p/wxWzQpRwWb/)**

How it looks in Kibana

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

---

<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:** [December 2, 2020, 5:47am UTC](https://discuss.elastic.co/t/no-sql-tracing-when-using-dapper-in-net-5/255032/2 "2020-12-02T05:47:00Z")

</div>

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