{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/issues/516","repository_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server","labels_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/issues/516/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/issues/516/comments","events_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/issues/516/events","html_url":"https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/516","id":224952989,"number":516,"title":"Track dependency instrumented with HttpDesktop DiagnosticSource in Response event (#509)","user":{"login":"lmolkova","id":2347409,"avatar_url":"https://avatars1.githubusercontent.com/u/2347409?v=3","gravatar_id":"","url":"https://api.github.com/users/lmolkova","html_url":"https://github.com/lmolkova","followers_url":"https://api.github.com/users/lmolkova/followers","following_url":"https://api.github.com/users/lmolkova/following{/other_user}","gists_url":"https://api.github.com/users/lmolkova/gists{/gist_id}","starred_url":"https://api.github.com/users/lmolkova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmolkova/subscriptions","organizations_url":"https://api.github.com/users/lmolkova/orgs","repos_url":"https://api.github.com/users/lmolkova/repos","events_url":"https://api.github.com/users/lmolkova/events{/privacy}","received_events_url":"https://api.github.com/users/lmolkova/received_events","type":"User","site_admin":false},"labels":[{"id":315295801,"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/labels/cla-not-required","name":"cla-not-required","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-04-28T01:05:40Z","updated_at":"2017-04-28T23:19:33Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/pulls/516","html_url":"https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/516","diff_url":"https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/516.diff","patch_url":"https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/516.patch"},"body":"See #509 for the details.\r\n\r\nPlease note:\r\n1. Before this fix, all dependencies are reported, but none of the dependencies instrumented with DiagnosticSource have proper Target with appId.\r\n\r\n2. After this fix\r\n  * dependency has proper target if AppId was returned in response header\r\n  * for requests with redirects, only first call is tracked (so the duration and status are wrong). This we should fix in DiagnosticSource.\r\n  * some dependency calls may be missed if they are done with WebRequest.GetResponse() AND response stream is not read. This is fundamental flaw in the reflection hook and there is no know solution for this issue. \r\nE.g.\r\n```C#\r\n            HttpWebRequest request = WebRequest.CreateHttp(\"http://localhost:3000\");\r\n            HttpWebResponse response = (HttpWebResponse)request.GetResponse();\r\n```\r\nWill never be tracked...\r\n\r\n```C#\r\n            HttpWebRequest request = WebRequest.CreateHttp(\"http://localhost:3000\");\r\n            HttpWebResponse response = (HttpWebResponse)request.GetResponse();\r\n            using (var reader = new StreamReader(response.GetResponseStream()))\r\n            {\r\n                reader.ReadToEnd();\r\n            }\r\n```\r\nWill be tracked.\r\n**This problem does not affect requests done with HttpClient.**\r\n\r\n------------------------------------\r\n**Considering that some dependencies may not be collected and it does not look fixable, please decide whether this fix should be taken at all.\r\nOtherwise, just keep current implementation (and sacrifice AppId for all dependencies).**"},"comment":{"url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/issues/comments/298127939","html_url":"https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/516#issuecomment-298127939","issue_url":"https://api.github.com/repos/Microsoft/ApplicationInsights-dotnet-server/issues/516","id":298127939,"user":{"login":"lmolkova","id":2347409,"avatar_url":"https://avatars1.githubusercontent.com/u/2347409?v=3","gravatar_id":"","url":"https://api.github.com/users/lmolkova","html_url":"https://github.com/lmolkova","followers_url":"https://api.github.com/users/lmolkova/followers","following_url":"https://api.github.com/users/lmolkova/following{/other_user}","gists_url":"https://api.github.com/users/lmolkova/gists{/gist_id}","starred_url":"https://api.github.com/users/lmolkova/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmolkova/subscriptions","organizations_url":"https://api.github.com/users/lmolkova/orgs","repos_url":"https://api.github.com/users/lmolkova/repos","events_url":"https://api.github.com/users/lmolkova/events{/privacy}","received_events_url":"https://api.github.com/users/lmolkova/received_events","type":"User","site_admin":false},"created_at":"2017-04-28T23:19:33Z","updated_at":"2017-04-28T23:19:33Z","body":"Update on the issue with not-tracked calls: they will be called if the response is closed/disposed properly.\r\n\r\n```C#\r\n            HttpWebRequest request = WebRequest.CreateHttp(\"http://localhost:3000\");\r\n            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())\r\n            {\r\n                Console.WriteLine(response.StatusCode);\r\n            }\r\n```\r\n\r\nIf app does not dispose WebRequests properly, it could experience a lot of other issues: e.g. reach connection limit.\r\n\r\nSo I do not consider this is a critical problem any more even fr WebRequests\r\n\r\n"}}
{"actor":{"display_login":"lmolkova"}}