microsoft / ApplicationInsights-dotnet

ApplicationInsights-dotnet
MIT License
566 stars 285 forks source link

Failed dependency without ResultCode #1580

Closed AlexKlimovMS closed 4 years ago

AlexKlimovMS commented 7 years ago

In live streams found following failed dependency without ResultCode: "DependencyTypeName": "Http", "DocumentType": "RemoteDependency", "Duration": "PT0.382S", "ResultCode": "", "Success": false,

Version of Microsoft.ApplicationInsights.DependencyCollector is 2.3.0-beta1. Could you please investigate/track with telemetry for which failed dependencies SDK fails to resolve ResultCode?

aloysiustany commented 7 years ago

Even I have recently seen the same issue with few HTTP dependencies.

target: graph.windows.net type: HTTP name: POST https://graph.windows.net success: False itemType: dependency ResultCode: ""

Microsoft.ApplicationInsights.DependencyCollector: v2.1.0

cijothomas commented 7 years ago

@AlexKlimovMS @aloysiustany - Do you have StatusMonitor/ApplicationInsights extension installed? The easiest way to tell is look for sdk version in the telemetry - is it starting with "rddp" or "rddf".

( its possible to have sucess:false with empty result code, i just need to focus the investigation to the right path rddp vs rddf)

aloysiustany commented 7 years ago

For dependencies without ResultCode (and success False), its rddp and for others (with proper ResultCode) its rddf.

AlexKlimovMS commented 7 years ago

@cijothomas, StatusMonitor is not installed

cijothomas commented 7 years ago

@aloysiustany Its unlikely to have both rddp and rddf in same application - do you use the same ikey for multiple applications? or are there different instance of the app, some of which have StatusMonitor installed and some dont?

cijothomas commented 7 years ago

@AlexKlimovMS @aloysiustany - if StatusMonitor/ApplicationInsights extension/Profiler is not installed, DependencyCollector module can set success = false with no result code, for any client side issues. (like invalid dns name, or a request to a url like google.com/404). Without profiler this is the best that can be done, as the dependency monitoring is done based on EventSource events written by the DotNetFramework, and it do not return a proper resultcode in case of client side errors.

If you install profiler, then you will see better result codes. i.e for the google.com/404 case, result code will be collected as 404. But if the request fails at dns resolution itself, then resultcode will not be populated at all.

(I do not know what is the specific cause of why you see empty resultCode for failures, but my best suggestion is to see install profiler and see if this throws some light into your failures.)

cijothomas commented 7 years ago

Related improvement: https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/335

cijothomas commented 7 years ago

Correction: event without profiler installed, we should still see 404 kind of errors captured into resulCode.

cijothomas commented 7 years ago

Its unlikely to make any difference installing Profiler. For errors occurring at client side, we don't populate resultcode, as there was no response received from the server from which to collect status code.

Dmitry-Matveev commented 6 years ago

@cijothomas, do we want to address anything beyond microsoft/ApplicationInsights-dotnet-server#335 to close this particular issue?

cijothomas commented 4 years ago

Closing old issue. Dep collection is now mostly from diagnosticsource callback.