-
Notifications
You must be signed in to change notification settings - Fork 286
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
Add "Transaction Id" and "Client Version" in Diagnostic Source traces #515
Conversation
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.
This can be optimized to simply pass the SqlTransaction object to the diagnostic events. Then use transaction?.InternalTransaction?.TransactionId
inside the anonymous type we create. This avoids the constant null checking in the calls to the diagnostic listener when there are no listeners enabled and looks cleaner, IMO.
Uploading NuGet Package for validation: Usage: |
...Data.SqlClient/netcore/src/Microsoft/Data/SqlClient/SqlClientDiagnosticListenerExtensions.cs
Outdated
Show resolved
Hide resolved
👍 Looks good to me, thanks for making these changes! |
Addressing request made by @davidmikh here: #93 (comment)
Hi @davidmikh
As per our offline discussions, I've made this PR to include "Transaction Id" to
SqlCommand
andSqlTransaction
events and "Client Version" inSqlConnection
events.Regarding other 2 requests:
SqlTransaction
events--
Connection.ClientConnectionId
contains this info.SqlConnection
open events--
Connection.ServerVersion
contains this info.Let me know if you need additional info from here.
P.S. Diagnostic Tests to be enabled in a separate PR (WIP @JRahnama PR #517)