.NET trace context in queries
Adding trace context to application queries provides the ability to correlate the queries from a traced transaction, and if sampled, the queries to the transaction trace detail. This feature is also a requirement for the integration of APM with DBO.
Enabling
Trace context propagation to queries is disabled by default. It can be enabled in the .NET Library using these configuration options:
-
InsertSqlTag: This option must be set to Enabled. -
InsertSqlTagDatabases: This option should be used to restrict context insertion to the database(s) relevant to the instrumented application.
Support Matrix
Trace context is inserted only for statements from a transaction sampled for detailed tracing.
Trace context is not inserted into server-side prepared statements and stored procedures.
| Database type | Requirements | Client library/ framework |
|---|---|---|
| MS SQL Server | ADO.NET data provider System.Data.SqlClient | |
| MySQL | ADO.NET data providers MySql.Data.MySqlClient and MySqlConnector | |
| PostgreSQL |
.NET 8+ or .NET Framework 4.6.2+ are supported.
Requires the |
Data provider Npgsql |