-
Notifications
You must be signed in to change notification settings - Fork 67
AI SDK does not collect HttpClient calls when response does not have content #739
Comments
@cijothomas @Dmitry-Matveev looks like all functional tests get some content in response. We might want to consider adding tests covering this case (once it is fixed). @lmolkova adding you to take a look once you have time |
Note:
|
//if the returned contentlength is zero, preemptively invoke calldone on the stream.
//this will wake up any pending reads.
if (m_ContentLength == 0 && m_ConnectStream is ConnectStream) {
((ConnectStream)m_ConnectStream).CallDone();
} http://referencesource.microsoft.com/#System/net/System/Net/HttpWebResponse.cs,525 in case there is a response body, I.e. by changing http desktop, we can react and send Stop event, however response object is not available. |
How can we stop Request-Context: appId=cid-v1:91e46abb-4ce5-4d98-9375-02378f649011 from response header? |
What is that Request-Context:appId=cid-v1 and why that is coming in Response Header? Somehow in my request response header "Request-Context" coming and i tried to remove that using in web.config and Response.Headers.Remove("Request-Context"); in global.asax but that header is not getting removed. In the value of that header I am getting some Appid and I am not sure from where that is coming. Here is response header of my request. Cache-Control:no-cache, no-store Any help appreciated. Thanks in Advance. |
@DeepakIoT The header is added automatically by AppInsights SDK. Why would you want to remove it? |
Thanks for your reply @lmolkova I want to remove the header because we are using some IOT devices which use payload and these devices have limited memory. Becuase of that payload size increased and iot device memory exhausted so I want to remove that unnecessary header which is not needed by us. If you guide me to remove this it will be very helpful. |
@DeepakIoT Let me know if it helps. |
I tried to add in applicationInsights XML file but that still not getting removed. Even I tried to disable Application Insight on our App also delete that applicationInsights XML file but that was still coming in the header. After these changes, we restarted app service as well. Do I miss something? I am attaching my applicationInsights XML file in which I made changes, I am still looking for your help :) |
this sounds strange. It does not prevent the header to be set in incoming requests - could it be the problem in your case? |
@DeepakIoT |
Now it's working and this header remove now from adding false as mentioned by previous thread by you. The problem was my end was that ApplicationInsights.config was residing at two places one in BIN and one to root directory so I was changing on BIN ones. Today I changed in root folder one and it's removed now. Thanks for all your help...!!! |
@lmolkova can you advice how to remove the Request-Context header in ASP.NET Core? I believe the RequestTrackingTelemetryModule doesn't exist in the ASP.NET Core SDK. At least I haven't found it. Sorry for hijacking the issue. |
@juho-hanhimaki, unfortunately, there is no such configuration option in AspNet Core SDK. Could you please create an issue in the https://github.com/Microsoft/ApplicationInsights-aspnetcore repo? If your scenarios are broken because of this header, please describe it in the issue. |
@lmolkova thanks for the info. Opened an issue at: microsoft/ApplicationInsights-aspnetcore#613 |
Its possible (but not so straightforward) in asp.net core sdk to configure dependencymodule to not inject headers. Will use the issue opened in aspnet core for any comments. |
@cijothomas, thanks! The problem is it's not possible to prevent header injection into the response of incoming request. I.e. there is no configuration for request tracking layer in asp.net core sdk. |
When an HTTP response contains only headers and not content (content-size = 0) then AI SDK (2.5-beta1) does not collect such calls as dependencies.
Repro
The following snippet for failure case should track 1) request (failed); 2) dependency (failed); 3) exception:
But with below response it tracks only request and exception but not dependency:
After modification the response and including content AI SDK successfully tracks all three documents:
Workaround
Add some content to response.
The text was updated successfully, but these errors were encountered: