-
Notifications
You must be signed in to change notification settings - Fork 1
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
Simplify continuous webjob by using background service #1
Conversation
…he startup exceptions
The other thing you should try is not directly using telemetry client and just logging the exception via ILogger. It should properly flow to AI if it is wired up properly and will make your code more portable. |
I just did exactly that here: af538e4. Still waiting to see if it was logged in AI. |
For some reason, with an instrumentation key specified (
Applications Insights still doesn't get anything. |
@davidfowl unrelated question - do I need to mark the host with |
In 3.0 we made that the default lifetime. I can’t recall the 2.2 behavior (I’ll check). If ctrl+c worked then it’s on |
Isn't there an API you can use in app insights to let it flush? Something like Serilog's close and flush https://merbla.com/2016/07/06/serilog-log-closeandflush/ |
Not according to this wiki:
But it doesn't seem to be the case. |
Interesting enough, log from @lmolkova I've wired AppInsights, but find it interesting that not all the logs are flushed. For example, the log from ApplicationInsightsWithWebJobs/AppInsightsWithWebJob/ContinuousJob.cs Lines 36 to 41 in de44ff3
Any pointers what should be done? |
@davidfowl I've raised an issue with WebJobs SDK. Seems like it's not playing nicely with the |
I cannot repro it - took your code and run it and I get all telemetry. Could you still repro it? I believe the possible issue is some ingestion incidents recently and they mostly affected .NET Core SDKs because of microsoft/ApplicationInsights-dotnet#1047, microsoft/ApplicationInsights-dotnet#1049 and microsoft/ApplicationInsights-dotnet#1114. We are going to ship stable version of ApplicationInsights SDKs with all these fixes and update web jobs sdk with it shortly. You may also install latest preview of Microsoft.ApplicationInsights package that should have fixes. |
I start suspecting there are a few things on my end:
Good to know about those issue. Those could influence it as well. |
We're going to ship stable version pretty soon (beginning of May) |
Unless what you meant is to force the transient dependency to be an explicit one and reference beta version of Microsoft.ApplicationInsights (2.10.0-beta3). |
right, the fixes are related to the channel to the backend and it is enough to install the Microsoft.ApplicationInsights (2.10.0-beta3) and (sorry, forgot to mention before) Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel (2.10.0-beta3). |
@lmolkova are you sure about |
yes, I'm sure. this is a dependency of Microsoft.Azure.WebJobs.Logging.ApplicationInsights |
I see what's going on. I've got confused with another project with webjobs where Do you know where I can find doco what packages are needed for what? |
Suggestions made by David.
@davidfowl did I capture your recommendations (1 and 2) correctly?