0
votes

I'm new to Application Insights Alerts and think I may have misconfigured something. I need to be alerted when an Azure Function fails to execute.

Setup App Insights Alert

  • Trigger alert when count of failures > 1 within a 60min period enter image description here

Alert triggered 3x in the past week enter image description here

No failure conditions have existed on this Function since 12/2/2020 enter image description here

How do I correlate an App Insights alert with its corresponding log file?

Seems like this should be a "one-click thing" but I must be missing it somewhere.

EDIT 1: Here is the exceptions table. Same findings; no fails since 12/2.

enter image description here

EDIT 2: Here is the dependencies table. Nothing found in last 30d.

enter image description here

EDIT 3: Per the recommendation on another post, I changed the alert from the out-of-the-box Metric to a Custom log search.

  • I left the original alert (that failed for no reason) in place alongside the new one.
  • The original one just failed again for no reason

Details:

  • Alert emails say:
    • Start 2021-01-06 8:22 UTC
    • End 2021-01-06 11:22 UTC
  • Function Monitor shows Function ran SUCCESSFULLY at:
    • 2021-01-06 08:13:21.368 UTC
    • 2021-01-06 08:13:21.372 UTC
  • Detailed logs show the function ran successfully

enter image description here

At this point, I'm going to say the Metric version of alerts should be discarded. What ever its logic is based on has created false positives for me a number of times now.

Stick to the custom log search

enter image description here

1
can you please also check the exceptions table and dependencies table in azure portal -> application insights -> logs, to see if any errors there?Ivan Yang
@IvanYang, please see Edit1&2 in OP. Nothing found in those tables.ericOnline

1 Answers

1
votes

The alert is triggered when at least 2 (because that is what the treshold of > 1 means) failures occur in a timespan of 1 hour. All three alerts of last week (2nd screenshot) where triggered on a different day.

Are you sure you don't need to set the threshold to Greater than 0 so that each failure triggers the alert?