What's wrong with my usage of Azure Alerts? - azure

OK, so I simply want to create an alert, for when my URL is unreachable.
As a test, I followed the steps found here to create an availability test for https://www.google.com, and as success criteria, I put 500 as my HTTP response; it was felt that this will trigger an alert.
The action group that I created is an MS Teams group; this is working, I know this because it is used by different alerts. Then, I created a new Alert, with the Condition of my newly created availability test, then I waited.
I expected to get an alert upon failure of my test. I can see that the test is failing, but there is no alert. What might I [not be grasping/be doing wrong]?

Turns out I must have mistyped something. All I know is that doing it from scratch (for the 3rd time) fixed it.

Related

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

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:
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:
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.

Email if a cron job succeeds on Cronitor

Is it possible to add a setting on Cronitor that sends an email once a cron job succeeds. Right now I only get email if a cron job fails.
This is what i have at the moment :
Alert preferences Failure tolerance Duration alerts
Alert notes
(X) Send alerts any time there is a problem
() Only send alerts if my job has consistently not run when expected...
I tried to email/contact support but now answer from Cronitor yet.
I'm one of the creators of Cronitor. I'm really sorry we somehow missed your support inquiry.
The answer is that, yes, this is possible but you cannot set this up without an API call. After the initial setup is complete (and the new alert rule is added) you can continue managing the monitor from the dashboard.
If you email support#cronitor.io again with specifics I can help you with adding this rule via the API.

How to create a metric alert in Azure that only fires during a specified timeframe?

I have a logic app set up that so that when a file is received on the FTP it gets put into the blob. The file is coming from a third party and it will be coming (supposedly) by 4am every morning. I want to set up an alert to know if the file didn't get received by 4am.
I've gone through all the different types of alerts and triggers, but I can't seem to figure out how to make one trigger when an event DOESN'T happen. I also can't figure out how to make the alert only check for a certain timeframe. I'm thinking I'm going to have to make my own alert by adding an action onto the logic app, but I'm at a loss.
Out of the box I don't think it's possible.
You could create a simple BlobTrigger Azure Function that when the file is changed/uploaded, the function will fire. When the function fires you can write a custom metric to app insights that you can then query on in the alert.
I solved this issue:
So I set up a logic app with a recurrence of 4am every day. It sets a flag variable to false, then lists every blob within the folder the blobs are coming in to. It checks every blob in it to see if the last modified date is today (the folder gets emptied daily with another logic) If it finds one it sets the flag as true and then nothing happens. If it doesn't the flag is still false so it sends an email saying the file was not sent today.

In Azure, how to suppress E-Mail-Alerts correctly?

I've established an email alert inside azure. This alert listens to the response times of a specific azue function. If the average response time exceeds a threshold (e.g. 300ms), then the alert will be triggered and an email will be sent. If the average response time falls below the threshold a couple of minutes later, then a second email will be sent ("alert resolved")
Furthermore I established a suppress condition which suppresses the alert at night.
I've noticed that the second resolve-mail will still be sent at night (when the suppress condition is active). The first trigger-mail will not be send at night anymore.
I want that the second resolve-email will also be really suppressed at night. Does anybody have an idea?
The ideal way to suppress notifications for your alerts would be to use the Action Rules feature, which is currently in preview.
The best part about action rules is that you can define them at any scope: at the subscription, resource group, or individual resource level, with other available filters. While all actions and notifications on the selected scope and filters will be suppressed for the time period configured, alerts will continue to monitor.
As an example, the following action rule is configured to suppress alert notifications from 7 PM - 7AM every day.
Please give it a try and see if it fits your need. More about this here. Hope this helps!

Why do I not get a warning from my alertrule?

In the portal (manage.windowsazure.com) I created a metric for a healthcheck of my vm:
configure -> monitor -> endpoints -> "http://mysite.cloudapp.net/my-healthcheck".
Then I created a new alert rule, where I chose this metric with response time and entered a threshold of 10 seconds:
For testing, I stopped my frontend on this VM. As you can see in the picture below, the response time passed my threshold.
But everything is "green" - no alert is shown. What did I miss?
Edit:
additional information:
For testing I created an alertrule for CPU usage over 0.1% on the same machine: this works (I get an alert) - but it still doesn't work for my self-created metric (although the threshold is passed). And in the preview-portal I don't even see my metric when I try to create an alert rule. Is this a bug?
So just a little time after I started the bounty, I found a solution by myself:
I had to go to the new portal (preview portal) and create an Application Insights-ressource. There, I go to "Availability" and create a new "webtest". Here I can enter a specific URL for testing and the expected response code (e.g. 200). This works for me now!
So now I have to find out what the difference between the pricing tiers is (what does "days raw data retained", "data points included" and "aggregated data" mean in that case?)

Resources