question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dapper Calls via Execute Aren't Instrumented

See original GitHub issue

Describe the bug Database calls using the Dapper library’s .Execute... method seem to delegate to IDbCommand.ExecuteNonQuery(), but they don’t appear when traced. Calls via .Query... are instrumented. This happens against both Sql Server and Postgres(using npgsql).

To Reproduce Super basic example gist is here. You’ll need to do some connection string swapping but hopefully this is clear enough.

Expected behavior 4 spans are created(2 for .Execute; 2 for .Query)

Screenshots https://cl.ly/592416576d1c

Runtime environment (please complete the following information):

  • Instrumentation mode: Automatic
  • Tracer version: 1.13.3
  • OS: Windows Server 2012 R2
  • CLR: .NET Core 2.2

Additional context This is a follow-up to https://github.com/DataDog/dd-trace-dotnet/issues/581 and https://github.com/DataDog/dd-trace-dotnet/issues/540

@bobuva Pinging you as you asked! Please let me know if I can add anything.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
bretkoppelcommented, Aug 10, 2020

@lucaspimentel Apologies for the delay - I finally had a chance to try out 1.19.0 and we are seeing these missing spans. Thank you! Feel free to close this out.

1reaction
lucaspimentelcommented, Mar 6, 2020

These log messages will be very useful, @bretkoppel. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Dapper Execute, ExecuteAsync, Insert, Update, Delete
Dapper allows you to execute non-query commands that are not intended to return resultsets, such as INSERT , UPDATE , and DELETE statements....
Read more >
Automatically Log All SQL Commands - Erik the <Coder>
I'd reference a SqlConnection instance in a private field and implement each method defined by IDbConnection- first logging SQL commands before ...
Read more >
How does Dapper execute query without explicitly opening ...
First is - Allow Dapper to handle it. Here, you do not need to open the connection before sending it to Dapper. If...
Read more >
A Practical Guide to Dapper - Simple Talk
Dapper is a lightweight framework for data access. Camilo Reyes explains how to query, call stored procedures, and more with Dapper in C#....
Read more >
Dapper, a Large-Scale Distributed Systems Tracing ...
analysis tools that have been built using Dapper, share statistics about its usage within Google ... Dapper's core tracing instrumentation to a small...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found