-
Notifications
You must be signed in to change notification settings - Fork 9
Add EFCore to example #144
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
Add EFCore endpoint to assert on OpenTelemetry.Instrumentation.EntityFrameworkCore in OATS.
721ddca
to
fa45cf8
Compare
- Try to fix failing query. - Improve some formatting.
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 an EFCore endpoint to the ASP.NET Core example to test OpenTelemetry instrumentation specific to EFCore using SQLite.
- Added Microsoft.EntityFrameworkCore.Sqlite package and updated Swashbuckle in the project file.
- Introduced new TodoApp endpoints, repository, and entity models to enable EFCore functionality.
- Updated docker-compose configuration to include the new endpoint and trace queries.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
File | Description |
---|---|
examples/net8.0/aspnetcore/aspnetcore.csproj | Added EFCore Sqlite package and upgraded Swashbuckle version. |
examples/net8.0/aspnetcore/TodoAppEndpoints.cs | Introduced TodoApp endpoints, repository, and EFCore context for the Todo application. |
examples/net8.0/aspnetcore/Program.cs | Registered the TodoApp endpoints in the application startup. |
docker/docker-compose-aspnetcore/oats.yaml | Included the new /api/todo/items endpoint and trace validation for EFCore instrumentation. |
Comments suppressed due to low confidence (1)
examples/net8.0/aspnetcore/TodoAppEndpoints.cs:103
- The CompleteItemAsync method returns a nullable bool to indicate a not found item, while DeleteItemAsync returns a non-nullable bool. Consider unifying the return types to provide a consistent API design for repository methods.
public async Task<bool?> CompleteItemAsync(Guid itemId)
I should add some metric assertions too (e.g. |
Pull request was converted to draft
We can add it after updating to the latest NuGet packages. |
Changes
Add EFCore endpoint to assert on OpenTelemetry.Instrumentation.EntityFrameworkCore in OATS.
SQLite is used as the SQL Server variant goes through the existing SQL instrumentation so it misses the point of testing that EFCore specifically is instrumented.
Merge requirement checklist
CHANGELOG.md
file updated for non-trivial changes