System.Data.SqlClient and Microsoft.Data.SqlClient by subscribing to the diagnostics they emit, creating a span for each command inside an active transaction.
Package installation
SqlClientDiagnosticSubscriber ships in the core Atatus package, so no separate package installation is required.
If you are already using the
Atatus.NetCoreAll package, SqlClient subscribers are wired automatically and no additional subscription code is required.Subscribe to SqlClient diagnostics
In ASP.NET Core, pass the subscriber toUseAtatus:
Configuration input variable is the IConfiguration instance passed to your Startup type. Alternatively, register it with the Agent.Subscribe method:
What Atatus captures ?
- A span for each SQL command executed through
System.Data.SqlClientorMicrosoft.Data.SqlClient, including the statement and the target database.