Scott Hanselman

Azure Application Insights warned me of failed dependent requests on my site

August 15, 2018 Comment on this post [7] Posted in Azure
Sponsored By

I've been loving Application Insights ever since I hooked it up to my Podcast Site. Application Insights is stupid cheap and provides an unreal number of insights into what's going on in your site. I hooked it up and now I have a nice dashboard showing what's up. It's pretty healthy.

Lovely graphics showing HEALTHY websites

Here's an interesting view that shows the Availability Test that's checking my site as well as outbound calls (there isn't a lot as I cache aggressively) to SimpleCast where I host my shows.

A chart showing 100% availability

Availability is important, of course, so I set up some tests from a number of locations. I don't want the site to be down in Brazil but up in France, for example.

However, I got an email a week ago that said my site had a sudden rise in failures. Here's the thing, though. When I set up a web test I naively thought I was setting up a "ping." You know, a knock on the door. I figured if the WHOLE SITE was down, they'd tell me.

Here's my availability for today, along with timing from a bunch of locations world wide.

A nice green availability chart

Check out this email. The site is fine; that is, the primary requests didn't fail. But dependent request did fail! Application Insights noticed that an image referenced on the home page was suddenly a 404! Why suddenly? Because I put the wrong date and time for an episode and it auto-published before I had the guest's headshot!

I wouldn't have noticed this missing image until a user emailed me, so I was impressed that Application Insights gave me the heads up.

1 dependant request failed

Here is the chart for that afternoon when I published a bad show. Note that the site is technically up (it was) but a dependent request (a request after the main GET) failed.

Some red shows my site isn't very available

This is a client side failure, right? An image didn't load and it notified me. Cool. I can (and do) also instrument the back end code. Here you can see someone keeps sending me a PUT request, perhaps trying to poke at my site. By the way, random PUT person has been doing this for months.

I can also see slowest requests and dig as deep as I want. In fact I did a whole video on digging into Azure Application Insights that's up on YouTube.

A rogue PUT request

I've been using Application Insights for maybe a year or two now. Its depth continues to astound me. I KNOW I'm not using it to its fullest and I love that I'm still surprised by it.


Friend of the Blog: Want to learn more about .NET for free? Join us at DotNetConf! It's a free virtual online community conference September 12-14, 2018. Head over to https://www.dotnetconf.net to learn more and for a Save The Date Calendar Link.

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook bluesky subscribe
About   Newsletter
Hosting By
Hosted on Linux using .NET in an Azure App Service
August 15, 2018 20:14
AppInsights is great, I just wish it was available in more regions! There were only 6 or 7 regions available last time I checked, and not the one I'm using :(
August 15, 2018 20:17
@Lucas so your web site has links to images that suppose to return 404? In this case you can un-check the check box that validates all page resources when creating a web test.

If you are talking about different feature - server requests returning 404 - you have options:


  • Filter those in UI or Analytics. In Failures blade - there is a button for it

  • Implement telemetry initializer to mark them as successful or telemetry processor to completely ignore http://apmtips.com/blog/2016/12/03/request-success-and-response-code/

  • August 16, 2018 7:08
    @Sergey, they're server requests returning a 404 for files not on my server (not a missing a missing file, just an incorrect request).

    I had setup an azure alert to email me if more than 5 server 404 requests occur in the span of 2 minutes, since as a .NET Core app a 404 error could mean a real error in our code, but too many false positives from external incorrect requests that I can't filter out.

    I've removed the alert, I'll just look at Azure portal from time to time to review until I find a better option.

    I do like the automated response degradation emails, it helps to pin points areas that need improvement.
    August 16, 2018 18:50
    @Lucas one option for you to investigate is to set a data-based alert like this: https://docs.microsoft.com/azure/log-analytics/log-analytics-tutorial-response. Perhaps you can check the url of failed requests and only alert for requests from your domain.
    August 18, 2018 15:07
    Amazing post Scott,
    My favourite Azure Application,

    Kevin
    August 20, 2018 21:29
    Hello Scott, I am facing a carzy issue since I added an application insights to our site. Everytime we publish some change even a single file like .aspx, it slows down first request to every resource of site. I guess it might be deleting the compiled version of pages, which generates on runtime. But why it deletes every page's compiled version when I am updating only one file of site? Also why it does same thing on code behind dlls update, if they are already compiled?

    I added application insights as a plugin instrumented directly from Azure portal. And my application is a asp.net webform application.

    Please share your thoughts to resolve this issue.
    August 27, 2018 18:10
    Now, if only API responses would use 400-style errors when they actually have a problem; we'd probably see just how inconsistent they may be. Sick of a 200 response with the body of
    {"success": "failure"}

    Comments are closed.

    Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.