Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EventSourceException while processing event "LogVerbose"

While using EventHubTrigger Azurefunction such a ugly exception received (As below) in telemetry traces of ApplicationInsights.

AI (Internal): [Microsoft-ApplicationInsights-Core] EventSourceException while processing event "LogVerbose": System.NullReferenceException:Object reference not set to an instance of an object.

Details :

timestamp [UTC] : 2019-01-24T04:10:02.5700507Z

message : AI (Internal): [Microsoft-ApplicationInsights-Core] EventSourceException while processing event "LogVerbose": System.NullReferenceException:Object reference not set to an instance of an object.

sdkVersion: dotnet:2.8.1-22898

like image 396
Rahul Modi Avatar asked Jan 24 '19 11:01

Rahul Modi


2 Answers

https://github.com/Microsoft/ApplicationInsights-dotnet/issues/973

The recommended workaround is to use 2.7.2 of Application Insights dependency.

For now, the options are:

  1. use the same version of AppInsihgts that Functions use (or lower)
  2. Filter out internal SDK messages. You can do this by creating and configuring telemetry processor. You can have a filter that checks if telemetry is TraceTelemetry and traceTelemetry.Context.Operation.SyntheticSource is SDKTelemetry
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.7.2" />

Otherwise there is pretty much nothing except to wait and hope that version 2.9 will contain a bugfix for this.

like image 114
Alex AIT Avatar answered Nov 07 '22 19:11

Alex AIT


As I have mentioned the link in comment regarding open GitHub issue: https://github.com/Microsoft/ApplicationInsights-dotnet/issues/1029

And @Alex AIT shared a link which is an open issue related the same problem : https://github.com/Microsoft/ApplicationInsights-dotnet/issues/973

However, I found a concrete answer with the reference of Microsoft Docs: Application Insights for Azure Functions supported features

In summary:

According to the reference by Microsoft Docs on Supported feature on azure function V2 with Application Insight, If you want to use Application Insight then set an Application Insights version 2.7.2 rather than 2.8.0 and 2.8.1. Some issues are responsible due to the Application Insights version: 2.8.0 and 2.8.1. So, we should use Application Insight version 2.7.2 till the new update is not coming from Microsoft/stable version for V2.

  • https://docs.microsoft.com/en-us/azure/azure-monitor/app/azure-functions-supported-features

Other Exceptions faced with Application Insights 2.8.1 such as

  • AI (Internal): ERROR: Exception in Command Processing for EventSource Microsoft-ApplicationInsights-Core: An instance of EventSource with Guid 74af9f20-af6a-5582-9382-f21f674fb271 already exists
  • AI (Internal): EventSourceException while processing event "DiagnosticsEventThrottlingHasBeenResetForTheEvent": System.NullReferenceException:Object reference not set to an instance of an object.

Now, which is resolved via to degrade the Application Insights version as 2.7.2 which is actually supported to Azure function V2.

like image 36
Rahul Modi Avatar answered Nov 07 '22 17:11

Rahul Modi