-
Notifications
You must be signed in to change notification settings - Fork 332
[Instrumentation.EFCore] Support use with SqlClient Instrumentation #2829
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
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #2829 +/- ##
==========================================
+ Coverage 73.91% 81.44% +7.52%
==========================================
Files 267 14 -253
Lines 9615 652 -8963
==========================================
- Hits 7107 531 -6576
+ Misses 2508 121 -2387
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Consume changes from open-telemetry/opentelemetry-dotnet-contrib#2829 for test purposes. Builds on top of #145.
Tests added based on the existing SqlClient integration tests. Reverting the original change in the first commit will cause the tests to fail. |
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.
Pull Request Overview
This PR adds support for using SqlClient instrumentation with EntityFrameworkCore by updating package references, adjusting activity source usage, and extending integration test coverage.
- Updated package references in test projects for Microsoft.Data.SqlClient, EFCore providers, and test containers.
- Added new integration tests and refactored activity source usage in the diagnostic listener.
- Updated changelog to document support for SqlClient instrumentation.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
test/OpenTelemetry.Instrumentation.SqlClient.Tests/OpenTelemetry.Instrumentation.SqlClient.Tests.csproj | Updated SqlClient package version |
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests.csproj | Updated EFCore provider versions and added project references |
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/ItemsContext.cs | Added new ItemsContext for EFCore tests using C# primary constructor syntax |
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/Item.cs | Added simple POCO for EFCore tests |
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs | Introduced integration tests for raw SQL and DataContext scenarios |
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkDiagnosticListenerTests.cs | Refactored test item instantiation to use object initializer syntax |
src/OpenTelemetry.Instrumentation.EntityFrameworkCore/Implementation/EntityFrameworkDiagnosticListener.cs | Updated activity source usage to reflect SqlClient vs. EFCore differences |
src/OpenTelemetry.Instrumentation.EntityFrameworkCore/CHANGELOG.md | Documented new SqlClient instrumentation support |
Comments suppressed due to low confidence (1)
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs:290
- The error message uses an extra '$' inside the string interpolation which results in an unintended literal. Consider removing the extraneous '$' to correctly interpolate the container type name.
throw new InvalidOperationException($"Container type '${this.fixture.DatabaseContainer.GetType().Name}' is not supported.");
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs
Outdated
Show resolved
Hide resolved
test/OpenTelemetry.Instrumentation.EntityFrameworkCore.Tests/EntityFrameworkIntegrationTests.cs
Outdated
Show resolved
Hide resolved
This PR was marked stale due to lack of activity. It will be closed in 7 days. |
Fix spelling in grammar in comment.
Add integration tests for EFCore using SQL Server and SQLite.
Rewrite the message.
Fix incorrect assertion of a value with itself.
Fixes #1764
Changes
Takes over from #2280 which went stale.
Just need to add tests.Merge requirement checklist
CHANGELOG.md
files updated for non-trivial changes