-
Notifications
You must be signed in to change notification settings - Fork 192
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
Isolated Functions ApplicationInsights DependencyTracking (Sql/ServiceBus) #822
Comments
I am facing the same issue. |
@paul-datatech911 can you share your bootstrapping code? The App Insights configuration in host.json will configure the behavior for the host, but the worker, which is the process you're issuing SQL queries from, won't be automatically configured to emit those traces. |
Here's an example from one of our FunctionApps. This also shows, btw, how we init required ServiceBus endpoints/subscriptions.
|
Also @fabiocav - is there documentation other than what I linked to in the original issue post that describes what other bootstrapping is needed? I guess for ASP.NET applications everything is magically wired up, but not sure where to do this for Generic Host stuff. |
This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. |
I have provided author feedback. |
@paul-datatech911 / @pseabury the documentation I would recommend as reference would be this, towards the end (in the Hope this helps! |
@fabiocav So should we be using the guidance here regarding non-AspNet applications for isolated functions also? In other words, would you recommend using the Microsoft.ApplicationInsights.WorkerService Paul |
@paul-datatech911 we don't have validation in place for that at the moment, but that seems suitable. Should do exactly what you're looking for. |
hi @fabiocav, will using Microsoft.ApplicationInsights.WorkerService as above resolve issues being reported around dependency logging not being correlated with request? |
@emiledawalibi it should. Have you found problems with it? @paul-datatech911 / @pseabury have you been able to validate the functionality? |
@fabiocav - I expect to get back to that task in the next few days and can report back then. |
@fabiocav No, for a v4 Isolated Function, adding Microsoft.ApplicationInsights.WorkerService and then calling
I also have host.config as follows:
|
@fabiocav OK another update - if I use the Microsoft.ApplicationInsights.WorkerService package AND configure it to use the legacy headers, it works. I feel like this might be more of a workaround than a solution. Official guidance for a situation like this would be beneficial.
|
Thank you for the update. We'll be flagging this as a scenario we need to investigate to define the work needed to remove this friction. Thanks for the update. Glad to hear this seems to be working for you at this point |
I've managed to solve this issue partially, I do get the end result as expected with correlated traces with dependencies. The only downside of my solution is you end up with two-parent operations. I've provided a few details on StackOverflow. Let me know whether someone found any better way to solve this issue. |
Please give the latest AppInsights package a try: #944 (comment). This should hopefully take care of a lot of the issues found in this thread. |
Reading the documentation linked earlier, it sounds like we will need some host side work to enable this. With the dotnet isolated, the user can no longer configure the host's |
Disregard this comment, I misunderstood the original issue. The issue is the SQL / ServiceBus calls are coming from customer code in the worker, not the host. This is now supported through the ApplicationInsights Worker package. Please see https://azure.microsoft.com/en-us/updates/generally-available-application-insights-integration-for-the-azure-functions-net-worker/. You will need to configure the app insights dependency tracking module there. |
Based on the very limited documentation about enabling Sql query tracking in Azure Functions, I believe I have the correct configuration and proper packages installed, but I still get no Sql Logging to ApplicationInsights. I also get no ServiceBus dependency data via ApplicationInsights. I only ever get a top-level function call timing.
From the output ApplicationInsightsLoggerOptions that are in the process debug info below, it appears to have read the configuration properly and be configured. Looking at sample data in the portal shows no dependency data at all, including no sql (see screenshot).
.Net6
Functions v4
Isolated Functions worker
Direct Dependencies
-Microsoft.Azure.Functions.Worker 1.6.0
-Microsoft.Azure.Functions.Worker.Extensions.Http 3.0.12
-Microsoft.Azure.Functions.Worker.Extensions.ServiceBus 5.0.0-beta.6
-Microsoft.Azure.Functions.Worker.Extensions.Storage 5.0.0
-Microsoft.Azure.Functions.Worker.Extensions.Timer 4.0.1
-Microsoft.Azure.Functions.Worker.Sdk 1.3.0
-Micosoft.ApplicationInsights.WorkerService 2.20.0
Indirect Dependencies
-Microsoft.EntityFrameworkCore.SqlServer 6.0.3
--Microsoft.Data.SqlClient 2.1.4
host.json
process debug info
The text was updated successfully, but these errors were encountered: