Skip to content
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

Enhance DiagnosticSource logging for SQLClientDiagnosticListener to support associating commands by transaction #32774

Closed
davidmikh opened this issue Feb 25, 2020 · 2 comments
Labels
untriaged New issue has not been triaged by the area owner

Comments

@davidmikh
Copy link

When using the WriteCommandBefore and WriteCommandAfter DiagnosticSource events defined in this file it doesn't seem like there's a way to associate commands with the transactions they were a part of. In the WriteCommand events you're able to tell if the command was part of a transaction based on the Transaction property of the SQLCommand being not null, however it doesn't seem like there's a way to tell which transaction the command was a part of since the transaction object itself doesn't have any public properties to help identify it from other transactions using the same connection. As a result you can't tell which commands were grouped together in which transaction, you can only tell if a command was part of a transaction at all. Would it be possible to add a property to the transaction object itself or to one of the WriteCommand DiagnosticSource events so that you can associate which commands were part of the same transaction together?

It would also be ideal if there was a way to associate the WriteCommand events with the WriteTransaction events for the queries that are part of a transaction, however I'd be happy with just being able to tell which commands are part of the same transaction.

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added the untriaged New issue has not been triaged by the area owner label Feb 25, 2020
@Wraith2
Copy link
Contributor

Wraith2 commented Feb 25, 2020

/cc @cheenamalhotra

@cheenamalhotra
Copy link
Member

Thanks @Wraith2 for the tag.

Hi @davidmikh

We're currently working on improving overall tracing experience in SqlClient (see issue dotnet/SqlClient#93), I will move your request to the same issue instead, so we'll remember to address this as well.

Closing issue in this repository.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

4 participants