ApplicationInsights-dotnet icon indicating copy to clipboard operation
ApplicationInsights-dotnet copied to clipboard

Exclude WebSocket Requests from "slow response time" rules of SmartDetection

Open ndreisg opened this issue 7 years ago • 23 comments
trafficstars

Hi there,

my WebApp handles WebSocket requests as well as normal HTTP requests. These days, I received some "slow response time" notification emails from AI for this WebApp. The response time of WebSocket Requests is naturally very high (time between open and close handshake).

Is it possible to exclude WebSocket requests from SmartDetection, so that I only get notifications if the response times of the normal HTTP requests are slow?

Best regards Alex

ndreisg avatar Jun 04 '18 09:06 ndreisg

Today I realized, that this problem also causes the Web App to recycle more frequently. In Application Events I had three Events with ID 2299 today (Worker Process requested recycle due to 'Percent Slow Requests' limit). Is it possible to deactivate this 'Percent Slow Requests' limit?

ndreisg avatar Jun 05 '18 14:06 ndreisg

Are you using .NET SDK? You can use telemetry processors to exclude web socket requests https://docs.microsoft.com/azure/azure-monitor/app/api-filtering-sampling

SergeyKanzhelev avatar Apr 26 '19 06:04 SergeyKanzhelev

This does seem like something that should be configurable out of the box.

jeffputz avatar Jun 01 '20 21:06 jeffputz

Same issue. This should be accounted for. App Insights treats this as an issue but this behavior is expected.

rickdgray avatar Jan 21 '21 20:01 rickdgray

This issue is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Nov 18 '21 00:11 github-actions[bot]

Bumping because this should be fixed

rickdgray avatar Nov 19 '21 17:11 rickdgray

This issue is stale because it has been open 300 days with no activity. Remove stale label or this will be closed in 7 days. Commenting will instruct the bot to automatically remove the label.

github-actions[bot] avatar Sep 16 '22 00:09 github-actions[bot]

Boing

jeffputz avatar Sep 16 '22 00:09 jeffputz

4 years old problem and no solution yet? Basically, "metricNamespace":"Microsoft.Web/sites","metricName":"HttpResponseTime" should not include WebSocket connections because they can last for hours and it is not what you expect to monitor or trigger alerts on.

igristov avatar Dec 07 '22 16:12 igristov

"metricNamespace":"Microsoft.Web/sites","metricName":"HttpResponseTime"

^ This is not something produced by the Application Insights SDK.

cijothomas avatar Dec 15 '22 05:12 cijothomas

Any update on this issue? I'm also running an App Service, which deals with web sockets with long running connections, we experience spikes in our average response time metric up to 1 hour.

Zurina avatar Feb 15 '23 18:02 Zurina

https://github.com/microsoft/ApplicationInsights-dotnet/pull/2372/files Fixed SDK to exclude long running SignalR connections.

SmartDetection is not part of this SDK. "metricNamespace":"Microsoft.Web/sites","metricName":"HttpResponseTime" - this metric is also not part of this sdk, so unfortunately, can't help.

cijothomas avatar Feb 15 '23 18:02 cijothomas

You could help by forwarding the issue to the right team

ndreisg avatar Feb 16 '23 08:02 ndreisg

Okay, can you point me in the right direction with a link?

Zurina avatar Feb 16 '23 10:02 Zurina

I do not know if teams outside of SDK have Github repo for reporting issues. If you see issue with application insights sdk produced metrics after https://github.com/microsoft/ApplicationInsights-dotnet/pull/2372/files, this is the right forum.

If it is about smartdetection - my only suggestion is to open Azure support ticket. "metricNamespace":"Microsoft.Web/sites","metricName":"HttpResponseTime" - If this is about who is producing this metric, my best guess is, its automatically done by Azure WebApps, so you need to create a support ticket for that too.

cijothomas avatar Feb 16 '23 13:02 cijothomas

It's pretty weird when someone inside the company asks someone outside of the company to influence a product decision, especially going through support, which I suspect we've all had, at best, mediocre interactions with.

jeffputz avatar Feb 16 '23 14:02 jeffputz

The issue is still happening and took me a while to understand that it wasn't a real problem with our application and I can't believe it hasn't been looked at yet after all these years...

rafaelgrilli92 avatar Jul 26 '23 22:07 rafaelgrilli92

The issue is still happening and took me a while to understand that it wasn't a real problem with our application and I can't believe it hasn't been looked at yet after all these years...

https://github.com/microsoft/ApplicationInsights-dotnet/pull/2372/files Has fixed this.

cijothomas avatar Jul 26 '23 23:07 cijothomas

The issue is still happening and took me a while to understand that it wasn't a real problem with our application and I can't believe it hasn't been looked at yet after all these years...

https://github.com/microsoft/ApplicationInsights-dotnet/pull/2372/files Has fixed this.

Was this fix released? I have the latest SDK for .Net (2.21.0) and I'm still getting very high response times on application insights while the response time of the rest of the application seems to be ok. Any suggestions? image

Edit: Actually, sorry, I updated the SignalR SDK, not the AppInsights. I will try

rafaelgrilli92 avatar Jul 26 '23 23:07 rafaelgrilli92