microsoft / ApplicationInsights-dotnet

ApplicationInsights-dotnet
MIT License
565 stars 287 forks source link

SQL dependency missing command text #768

Closed andygjp closed 6 years ago

andygjp commented 6 years ago

Repro Steps

I browse an entity set in the browser (my app is an OData Web API app) that causes a query to be executed. The SQL dependency event is captured, but its missing the command. I have restarted and stop/started the web app many times.

The ApplicationInsights.config, containing the key, is deployed with the app. I have added the same key to the APPINSIGHTS_INSTRUMENTATIONKEY web app application setting.

Where am I going wrong?

Actual Behavior

The SQL dependency event does not show the command, just the database server and database name. The SDK version is reported as rddf:2.5.1-195

Expected Behavior

The command should be populated with the command

Version Info

Azure Web App

.NET 4.7.1

Autofac v=4.6.2
Autofac.WebApi2 v=4.1.0 EntityFramework v=6.2.0 FeatureSwitcher.Configuration v=1.0.1 Microsoft.ApplicationInsights.DependencyCollector v=2.5.1 Microsoft.ApplicationInsights.TraceListener v=2.5.0 Microsoft.ApplicationInsights.Web v=2.5.1 Microsoft.AspNet.OData v=6.1.0 Microsoft.AspNet.WebApi.Owin v=5.2.4 Microsoft.OData.Core v=7.4.1 Microsoft.Owin.Cors v=4.0.0 Microsoft.Owin.Host.SystemWeb v=4.0.0 Serilog v=2.6.0 Serilog.Enrichers.Environment v=2.1.2 Serilog.Enrichers.Process v=2.0.1 Serilog.Settings.AppSettings v=2.1.2 Serilog.Sinks.ApplicationInsights v=2.6.0 System.Net.Http v=4.3.3

image

cijothomas commented 6 years ago

SDK version 'rddf:..' indicates extension is not installed correctly. Can you remove and then re-install the Application Insights extension, followed by WebApp restart? SDK version would be 'rddp..' when extension is successfully installed.

andygjp commented 6 years ago

Hi @cijothomas,

I've tried as you've suggested, but I still get rddf.

Does the type of app plan matter? (I'm using the free tier.)

Anymore information I can add that'll help diagnose the issue?

Cheers, Andy

cijothomas commented 6 years ago

How did you add SDK to the application? Did you add SDK to the app before deploying to WebAPP? The package Microsoft.ApplicationInsights.Agent.Intercept is missing in the list (which is a dependency for DependencyCollector) and required for collecting SQL full statements.

clguiman commented 6 years ago

@andygjp please enable extension logging by editing D:\home\SiteExtensions\Microsoft.ApplicationInsights.AzureWebSites\applicationHost.xdt and uncomment the lines below this :""

After you edit the file restart the web site (from Azure Portal) and Kudu (from https://.scm.azurewebsites.net/SiteExtensions click on 'Restart site')

Try and reproduce the issue then email me the contents of 'D:\home\LogFiles\ApplicationInsights' at clguiman@microsoft.com

andygjp commented 6 years ago

Hi @cijothomas,

There is a Microsoft.AI.Agent.Intercept.dll in the bin directory - its a dependency of the Microsoft.ApplicationInsights.DependencyCollector package.

Cheers, Andy

andygjp commented 6 years ago

Hi @clguimanMSFT,

I've emailed the log files.

Thanks, Andy

andygjp commented 6 years ago

App Insights doesn't support free tier: https://docs.microsoft.com/en-us/azure/application-insights/app-insights-profiler#why-cant-i-find-any-stack-examples-even-though-profiler-is-running