Open vrooijen opened 1 year ago
@vrooijen We will check this issue with our next level team and update you.
Thank you for bringing this to our attention. This is not entirely unexpected with how our observability works today. The HTTP call made in your function directly and in the custom binding happen at completely different points in time during the function invocation. In v4, they may also even happen in different processes (host vs worker). It is interesting the explicit TrackDependency
call is not working at all. Does the TrackDependency
call work for you in other parts of the application?
We are working on improving our observability, and this is something we can definitely evaluate as part of that work. I see value in having this properly correlated.
Yes so in the binding attribute TrackTrace is working, but not TrackDependency (this is noticed because HttpClient also doens't track dependencies in Application Insights in the custom binding)
In the function itself, both are working
However this is not only on Azure but also when debugging locally, I guess in that case it woudn't be a different process right?
I've created an repo to reproduce this https://github.com/vrooijen/CustomBindingAttribute Notice the MyLogic.Track method is called twice, once in the CustomBindingAttribute and once in the function itself.
I've noticed, when the APPINSIGHTS_INSTRUMENTATIONKEY setting is not configured in the local.settings.json, it does output someting when calling TrackDependency, strangey there is not any record of this when the instrumentationkey is configured, however in the function itself it does work als described previously
All able to reproduce both in Azure as well as running locally
Application Insights Telemetry (unconfigured): {"name":"AppDependencies","time":"2022-11-03T13:25:31.4313764Z","tags":{"ai.cloud.roleInstance":"*","ai.internal.sdkVersion":"azurefunctionscoretools: 4.0.4829"},"data":{"baseType":"RemoteDependencyData","baseData":{"ver":2,"name":"http://localhost","id":"99b12e28faa02df9","data":"/api","duration":"00:00:00.1000000","success":true,"type":"HTTP"}}}
Can you clarify for me:
When executing the http call in the function itself, and also the custom TrackDependency execution, both show up in Application Insights however in the function itself it does work als described previously
Do you mean when you make the manual .TraceDependency()
call within your function body, does it show up in Application Insights or not? And in your shared repro, does the TrackDependency
in MyLogic.Track()
work? If you can provide a table of scenario and app insights call (trace, dependency, etc) and the result that would be helpful.
In binding: tracktrace is working, trackdependency is not In function: both are working
Any update on this issue? I am also missing dependency tracking in app insights. A workaround would also be appreciated :)
I've created a custom binding attribute as described here and here In this binding a http call is executed, which doesn't show up as a dependency in Application Insights, however TraceTelemetry is visible. Also tried to implement TelementryClient and use TrackDependency manually like described here but this it still won't show up.
When executing the http call in the function itself, and also the custom TrackDependency execution, both show up in Application Insights
Azure Function version v4 linuxFxVersion DOTNET|6.0
sampling is disabled in host.json