-
Notifications
You must be signed in to change notification settings - Fork 308
Merge | Port XEvents activity ID correlation to .NET Core #3373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Also add comment to TdsParser referencing MS-TDS specification
/azp run |
Azure Pipelines successfully started running 2 pipeline(s). |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3373 +/- ##
==========================================
- Coverage 67.04% 62.30% -4.75%
==========================================
Files 300 292 -8
Lines 65376 65229 -147
==========================================
- Hits 43831 40639 -3192
- Misses 21545 24590 +3045
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/Microsoft.Data.SqlClient/tests/ManualTests/DataCommon/DataTestUtility.cs
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, great changes, I appreciate your efforts on these, @edwardneal !!
Description
If tracing was enabled, the netfx version of SqlClient would send the current activity ID to the remote database server. This functionality was part of TdsParser and would be covered by the merge, but it lacked test coverage. I've ported the feature to netcore and added a test.
As a result, it's now possible to enable tracing, then link the activity ID of a SqlCommand to the
attach_activity_id_xfer
value of the appropriate server-side XEvent. The XEvents can then be correlated further within SQL Server. We gain end-to-end trace correlation. In the future, this could be used to link OpenTelemetry spans into SQL Server XEvents.A fuller description of the feature (albeit one which is described in terms of SQL Server Native Client) is documented here.
Issues
Relates to #1261.
Testing
Added one new functional test. This test enables tracing and XEvents, then runs a simple query or stored procedure and compares the activity ID recorded by the XEvents trace to the activity ID recorded in the SqlClient tracing.