Alerting from a custom event in azure application insights not firing

1.2k views Asked by At

I have a .net application uploading customEvents to application insights. I'd like to create an alert to trigger when a scanning (like a heartbeat) message hasn't been sent.

If I run the following log query I get back what I think looks like something I can alert on:

app('dev-insights').customEvents
| where name == "Scanning"
| project-rename TimeGenerated = timestamp
| make-series kind=nonempty counts=count() default=0
              on TimeGenerated in range(ago(1h), now()-5m, 5m) 
| mv-expand TimeGenerated, counts
| project todatetime(TimeGenerated), toint(counts)
| summarize AggregatedValue=avg(counts) by bin(TimeGenerated, 5m)

And I get results like this:

enter image description here

But with the following in azure alerts it never seems to fire:

enter image description here

Is this something that should be possible? I notice that the graph in the alert preview never looks right which I suspect is something to do with the issue, but seeing as the raw log query looks ok I'm a bit stuck.

Ideally I guess I'd prefer this to be a metric alert as I think if even I can get this to work I'll get an alert sent every time the condition is true rather than just one when it triggers and one when it resolves. Is there any way to achieve that?

0

There are 0 answers