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

ApplicationInsights dependency tracking not working #308

Closed
allanlw opened this issue Mar 16, 2021 · 4 comments
Closed

ApplicationInsights dependency tracking not working #308

allanlw opened this issue Mar 16, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@allanlw
Copy link

allanlw commented Mar 16, 2021

Since I upgraded to the new runtime, dependency tracking is not working. It would seem that it is necessary to manually enable this (not documented).

Is there a recommended way to configure Application Insights and/or an example?

@fabiocav
Copy link
Member

@allanlw indeed, this would require some manual wire up at the moment.

Tagging @brettsam so we can discuss how we can automate this to remove that friction.

@asparrowhawk
Copy link

asparrowhawk commented May 12, 2021

Tried using DependencyTrackingTelemetryModule to add application insights into a .NET 5.0 function app. However I got a number of these messages in application insights logs:

AI (Internal): [Microsoft-ApplicationInsights-Extensibility-DependencyCollector] HttpCoreDiagnosticSourceListener OnNext failed to call event handler. Error details 'System.InvalidCastException: [A]ActivityStartData cannot be cast to [B]ActivityStartData. Type A originates from 'System.Net.Http, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\5.0.4\System.Net.Http.dll'. Type B originates from 'Grpc.Net.Client, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d754f35622e28bad' in the context 'Default' at location 'C:\home\site\wwwroot\Grpc.Net.Client.dll'.
   at Microsoft.ApplicationInsights.Common.PropertyFetcher.PropertyFetch.TypedFetchProperty`2.Fetch(Object obj)
   at Microsoft.ApplicationInsights.Common.PropertyFetcher.Fetch(Object obj)
   at Microsoft.ApplicationInsights.DependencyCollector.Implementation.HttpCoreDiagnosticSourceListener.OnNext(KeyValuePair`2 evnt)'

None of the http or table storage dependency events that I was hoping to see appeared in the logs.

The only dependency event type was:

http://127.0.0.1:51170/AzureFunctionsRpcMessages.FunctionRpc/EventStream

See Setup automatic dependency tracking in Console Apps for details.

@roend83
Copy link

roend83 commented Jul 19, 2021

Using the Microsoft.ApplicationInsights.WorkerService package works for getting dependencies logged, but the telemetry isn't associated with the function execution. Is there an easy way to bridge that gap?

@brettsam
Copy link
Member

This is now supported with the ApplicationInsights package: #944

@jviau jviau assigned jviau and unassigned jviau Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants