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.

Add Tracing in SqlClient

See original GitHub issue

SqlClient doesn’t have any tracing in .Net Core. All the Bid Tracing API calls were removed during the port to Core. One of the options is to use EventSource to emit traces during runtime. Something similar was done by @stephentoub in System.Data.Common . Ref: https://github.com/dotnet/corefx/blob/master/src/System.Data.Common/src/System/Data/Common/DataCommonEventSource.cs

cc @corivera

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:18 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
cheenamalhotracommented, May 5, 2020

Closing issue since EventSource tracing is now added to SqlClient.

2reactions
rojicommented, Oct 5, 2019

It does seem that both styles of tracing may be relevant, although it also seems that there is considerable overlap in what they provide, and I personally still don’t have a 100% clear picture of which should be used for what.

Regardless, what would be really great is some sort of quick spec/writeup on which events you’re planning to emit and when, before implementation. That would allow us to have a more concrete conversation about it possibly align across different ADO providers.

Note: in addition to https://github.com/dotnet/corefx/issues/21160, https://github.com/dotnet/corefx/issues/29534 is an additional issue I filed at the time. tl;dr SqlCient’s current implementation of DiagnosticSource seems like it doesn’t really follow best practices. I understand that the priority here is to bring over what exists from Core to Framework and not to change things, but this could also be a good moment to rethink the DiagnosticSource support itself. If you’re willing to do this, I’d be happy to work together and produce a spec.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Enable event tracing in SqlClient - ADO.NET Provider for ...
Start PerfView and run Collect > Collect from the menu bar. · Configure the trace file name, output path, and provider name. ·...
Read more >
Tracing System.Data.SQLConnection (SqlClient)
I'm writing a .Net application with db connection and queries. Using Syste.Data.SqlClient. I'd like to trace each sql executed by my application ...
Read more >
SQL*Net tracing tips
STEP 1: Make a SQL*net trace file directory on the client machine called c:\trace. STEP 2: Add the following lines to your sqlnet.ora...
Read more >
Tracing .NET Applications Easily With OpenTelemetry
In this article, we take a look at tracing in .NET applications, starting with the auto-instrumentation libraries and then custom traces.
Read more >
Tracing SQL queries with the X-Ray SDK for .NET
You can execute the query asynchronously by using the ExecuteReaderAsync method. Example Controller.cs - SQL client instrumentation (asynchronous). using Amazon ...
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