Open karun-verghese opened 9 months ago
https://github.com/microsoft/ApplicationInsights-dotnet/tree/develop/examples/WorkerService There is an example shared in this repo. Is that no working? i.e is that not capturing Logs?
@cijothomas In the example you shared, do you mean the use of some CustomTelemetryProcessor? Other than that, the example looks pretty similar to what I had done above.
One question, does the fact that we are not using the Worker SDK but only the .Net SDK make a difference? That's something I did not try.
In the example you shared, do you mean the use of some CustomTelemetryProcessor?
No. telemetry processor is just shown for example, and has no impact to telemetry pipeline.
Have you confirmed if the shared example is working or not?
I faced the same issue when I was trying to follow the console app instructions. This is what saved me: https://stackoverflow.com/questions/77565541/logs-not-appearing-in-application-insights-for-azure-functions-v4-with-net-8/77948360
Dear team,
I have a .net core Worker service for which I had configured App Insights using the below snippet in my ConfigureServices method:
Using this (the above snippet uses the Microsoft.Azure.WebJobs.Logging.ApplicationInsights package which I know is related to another repo, but bear with me) I was only able to see traces and exceptions in my logs. I wanted to setup telemetry to track my dependency calls as well. So after reading up, I tried to use and configure the ApplicationInsights.WorkerService library instead of the above package. So my new setup looked like below:
My dependency telemetry started showing up, but now my traces disappeared.
Following your documentation here, I provided a specific override for ApplicationInsights in the configuration(with the "Information" level enabled) , but this did not work either. I still only saw the dependencies in my logs.
The only way I got both my traces and dependencies working is to use both the packages and configure them very specifically in the following order:
Can you please check why the logging of traces does not work? I would expect that only the WorkerService SDK is required since it has all the providers required according to the documentation.
Further information on my setup: .Net Core 8.0 Project SDK used -> Microsoft.NET.Sdk