Is there a way to get notified by Azure ApplicationInsights when a new exception appears?

Viewed 506

We are using Application Insights by Azure. At the moment I have to manually check the exceptions after each deployment to see if a new one appeared. Has anyone figured out a way to get notified (via Azure alert) once a new exception appears? For example, other error trackers like Sentry support this.

Example:

  • We did a deployment at 15:15
  • A previously unknown exception appears at 15:17
  • An email is sent to me with content "New exception X appeared in project Y"

Here is a screenshot demonstrating this a bit more clearly:

application insights

2 Answers

Smart detections are being replaced by alets. The only way to get notifications is to write a query that will see your new exceptions. Configure the period to let alerts activate.

  • Navigate to the Application insights resource on Azure Portal.

  • Select Logs under the Monitoring blade.

  • Construct your log query and check the results.

  • Click on + New alert rule.

  • Configure your alert as follows:

58181-image.png

The above alert fires whenever the count of results in Custom log search log query for the last 1 day is greater than 0, and is evaluated every 6 hours. You can customize the Period and frequency as needed.

You can also run through this detailed guide for troubleshooting problems with Azure Monitor alerts. Please check if this helps.

You can try Smart Detection, specifically the alert for abnormal rise in exception volume.

When would I get this type of smart detection notification?

You get this type of notification if your app is showing an abnormal rise in the number of exceptions of a specific type, during a day. This number is compared to a baseline calculated over the previous seven days. Machine learning algorithms are used for detecting the rise in exception count, while taking into account a natural growth in your application usage.

If you never got a specificy exception before a release, I would consider that a rise in exceptions for that type and you should get an alert. Though the alert won't happen if there are very few exceptions occuring, and it won't be as detailed as you described in your question.

Related