-
Notifications
You must be signed in to change notification settings - Fork 285
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
Fix | Revert Event source changes on TryBeginExecuteEvent and WriteEndExecuteEvent to address the failure on other MS products. #1258
Fix | Revert Event source changes on TryBeginExecuteEvent and WriteEndExecuteEvent to address the failure on other MS products. #1258
Conversation
Interesting problem. Was it an issue because the connection id was added in the middle of the argument list or would any change at all cause issues? It is unfortunate that we can't make the events richer. Can AppInsights and OpenTelemetry suggest ways that we can enhance the traces without breaking them? |
I do not have much detail on the problem, but apparently Expected
And for EndExecute accordingly is:
I think they are waiting those values in their own event listener. |
I've asked on the original issue in OpenTelemetry, hopefully we can get some useful feedback. |
Cross-posting from the comment in the Otel issue: if you add additional payload at the end then it should be good enough to satisfy both OpenTelemetry and AppInsights. Hopefully this way works for everyone! Happy to test out any changes to verify both OpenTelemetry and AppInsights. |
Excellent, so we can just swap the field order around and it should be ok. The question is whether we want to do the same thing for all the events in SqlClient @JRahnama. |
I will fix the part related to the recent request, I am not sure what you mean about all the events in |
I thought there were other trace methods which took the connection id guid. I've looked and there don't seem to be, I was just mistaken. Just changing BeginExecute to the version which has 4 payload items is enough, then the TryBeginExecute can call that one. Same pattern with EndExecute. |
@mbakalov If you want to test the version from this PR the artifacts are at https://dev.azure.com/sqlclientdrivers-ci/7540d8a3-c1bc-4428-a007-d4b50b7762f4/_apis/build/builds/38263/artifacts?artifactName=Nuget&api-version=6.0&%24format=zip . There's a major version release coming up and I'm not sure if this can be pushed in at the last minute but if it can it'd be nice to get it done as soon as possible. |
Confirming this fixes the Application Insights issue microsoft/ApplicationInsights-dotnet#2346 as well, verified with a simple web app: dependency is captured using sqlclient 2.1.3, then not captured using 3.0.0, then again captured using the ci nuget. |
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.
A freindly reminder: don't forget to add a complimentary note over this class and explain the
considerable criteria related to OpenTelemetry and ApplicationInsight.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/SqlClientEventSource.cs
Show resolved
Hide resolved
…lientEventSource.cs Co-authored-by: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
…lientEventSource.cs Co-authored-by: DavoudEshtehari <61173489+DavoudEshtehari@users.noreply.github.com>
There was an older |
Yes, please. There is no guarantee it remains the same. So, it'd better have a general idea over the class with useful links for further changes to prevent any regression. |
…t-EventSource-internal
Other Microsoft products such as OpenTelemetry and Application Insight are facing difficulties in their products with the changes made to EventSource in v3.0.0.
This PR reverts those changes to accept:
ObjectId
DataSource
Database
CommandText
variables for
TryBeginExecuteEvent
andObjectId
CompositeState
SqlExceptionNumber
variables for
TryEndExecuteEvent
@mbakalov can you check the changes from this build and confirm if the issue is resolved.