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

EF Core SqlClient and App Insights #52

Closed
MaximBalaganskiy opened this issue Feb 15, 2017 · 11 comments
Closed

EF Core SqlClient and App Insights #52

MaximBalaganskiy opened this issue Feb 15, 2017 · 11 comments
Labels
ℹ️ Needs more Info Issues that have insufficient information to pursue investigations

Comments

@MaximBalaganskiy
Copy link

What can be the reason for not seeing raw SQL in EF app insights in net core project? Not locally nor in Azure.

I remember at some point with one of the RCs I saw SQL logged but not anymore.
Originally, I posted the question here dotnet/efcore#5510 but was referred to this repo.

@karelz
Copy link
Member

karelz commented Feb 15, 2017

What you don't see? Which type of project? (is EF special project type?)
Do you have minimal repro? (starting with new app without anything)

@MaximBalaganskiy
Copy link
Author

MaximBalaganskiy commented Feb 15, 2017

EF is EntityFramework, used in Asp.Net Core 1.1 project. Dependency telemetry does not have SQL text.
Repro is easy - fresh Asp.Net Core application with Individual accounts auth in VS 2015.

@saurabh500
Copy link
Contributor

@MaximBalaganskiy What kind of telemetry are you expecting here?
From what I know SqlClient doesn't emit any SQL on its own. There is a tracing mechanism on .Net Framework which is disabled by default and is usually not enabled without some registry modifications and some setup on the client machine..
I don't think this is a SqlClient issue.

Are you contrasting the usecase with .Net Desktop? If yes, can you give me the steps to follow to get the SQL logging you are talking about?

@MaximBalaganskiy
Copy link
Author

Here is the comment which got me here
dotnet/efcore#5510 (comment)

@MaximBalaganskiy
Copy link
Author

I used to see the actual SQL command in dependency details in VS
image
and in Azure. But now I cannot even reproduce this with EF6

@rwatjen
Copy link

rwatjen commented Nov 2, 2017

This seems to still not work with ASP.NET Core 2.0 and Entity Framework Core 2.0. The Azure Application Insights team points here (the link that @MaximBalaganskiy has posted). It would be great if someone could take on the issue and either solve it or make it very clear in the Application Insights documentation that this does not actually work for Core.

@rwatjen
Copy link

rwatjen commented Nov 8, 2017

I was just informed by @cijothomas that this works with Application Insights for .NET Core 2.2.0-beta1. (https://github.com/Microsoft/ApplicationInsights-aspnetcore/releases/tag/v2.2.0-beta1)

@cijothomas
Copy link

Yes. If you .net core application is targeting the full .NET Framework, then sql calls should have been automatically monitored.
But if you are targeting .NET Core, then support for this started with 2.2.0-beta1 of the SDK.
https://github.com/Microsoft/ApplicationInsights-aspnetcore/releases/tag/v2.2.0-beta1
You need to explicitly update to the above package, as the version of ApplicationInsights SDK shipped with Microsoft.AspNetCore.All 2.0 is 2.1.1.

@divega divega transferred this issue from dotnet/corefx May 16, 2019
@divega
Copy link

divega commented May 16, 2019

As recently announced in the .NET Blog, focus on new SqlClient features an improvements is moving to the new Microsoft.Data.SqlClient package. For this reason, we are moving this issue to the new repo at https://github.com/dotnet/SqlClient. We will still use https://github.com/dotnet/corefx to track issues on other providers like System.Data.Odbc and System.Data.OleDB, and general ADO.NET and .NET data access issues.

@David-Engel
Copy link
Contributor

Can anyone confirm that this is fixed in .NET Core 2.2?

@David-Engel David-Engel added the ℹ️ Needs more Info Issues that have insufficient information to pursue investigations label May 20, 2019
@cijothomas
Copy link

#52 (comment) This is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ℹ️ Needs more Info Issues that have insufficient information to pursue investigations
Projects
None yet
Development

No branches or pull requests

8 participants