Repository navigation
Set SQL connection registered application for EF Core telemetry - #39698
Merged
Merged
Conversation
- Identify EF-created runtime and scaffolding connections as EntityFrameworkCore - Preserve caller-provided connection identities and cover runtime and master connections Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the SQL Server connection telemetry changes.
No open issues 🎉
What changed in this PR
Addresses #39699 by identifying EF Core-created SQL Server connections in SqlClient telemetry while leaving caller-supplied connections unchanged.
Changes:
- Sets
RegisteredApplication.EntityFrameworkCorefor runtime connections, including master connections. - Applies the same setting to reverse-engineering connections created from connection strings.
- Adds assertions for runtime and master telemetry settings and preservation of caller-supplied values.
| File | Description |
|---|---|
test/EFCore.SqlServer.Tests/Storage/Internal/SqlServerConnectionTest.cs |
Verifies telemetry settings and preservation of caller-supplied values. |
src/EFCore.SqlServer/Storage/Internal/SqlServerConnection.cs |
Sets the telemetry identity when creating runtime and master SQL connections. |
src/EFCore.SqlServer/Scaffolding/Internal/SqlServerDatabaseModelFactory.cs |
Sets the telemetry identity for factory-created reverse-engineering connections. |
Review effort: Balanced
Code coverage overviewLanguages: C# C# / code-coverage
View coverage of the 10 most impacted files.
ℹ️ Calculations represent line coverage. Results may change as calculations are updated. |
4 of 6 tasks
AndriySvyryd
approved these changes
Nov 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set
SqlConnection.RegisteredApplicationtoRegisteredApplication.EntityFrameworkCorewhen EF creates runtime, master, and reverse-engineering connections so SqlClient reports EF Core telemetry. Caller-supplied connections remain unchanged, since they may already be open.Fixes #39699
Validation:
dotnet test .\test\EFCore.SqlServer.Tests\EFCore.SqlServer.Tests.csproj -- --filter-method "*SqlServerConnectionTest.*"passed (9 tests). This command built the affected projects; the full suite and CI checks have not been run locally.