Application Insights alerts for custom requests - azure

I'm trying to figure out how I can set up Email/Text alerts for custom requests inside application insights.
I have a number of different custom requests that are uniquely identified by a property in application insights. I can filter on these properties in the Metrics Explorer and even create graphs of the server response time for these specific requests. However I cant figure out how to set an alert if the server response time (for this individual custom request) goes over a certain threshold.
I've tried added a new metric alert rule but the only Metric that is relevant in the drop down in Server Response Time but there appears to be no way to specify this to a specific type of request as identified by a property on the request.
Would anyone know if this is currently possible in application insights and possibly be able to point me in the right direction.
Thanks for your help.

There are two options:
1) Call TrackMetric (provide some metric name) when particular request happens. Then configure alert based on this metric.
2) Write a tool/service/azure function which every few minutes runs a query in Application Insights Analytics and posts result as metric (using TrackMetric). Then configure alert from portal.
Right now AI team is working on providing #2 out of the box.

Related

AppInsights tile with single metric

How can I make a single tile 1x1 with a single metric in it?
Some of the default tiles that come with the dashboard show a single metric such has user count. How can I make my own metric that is shown?
Eg, number of exceptions?
Something like this?
How can I make my own metric that is shown?
You can create your own metric like Requests, Number of Exceptions, and others in Application Insights and pin them to Dashboard by following the steps below:
In the Application Insights resource deployed on Azure Portal--> under Monitoring --> Logs --> write your custom query in Kusto.
After running the above query, you will get the results and you can select the type of chart to use and pin that to the dashboard.
Refer this link to know complete information step by step about Creating Custom Tiles In Microsoft Azure Application Insights.

Azure Alert based on reading Odata

I have an application installed on a VM that publishes a page via OData.
I need to be able to trigger a high urgency alert based on one specific value published by the page.
I am little aware of Application Insights to monitor applications in Azure. But I am not sure if there is a way to read the data from the API and trigger an alert.
What options do I have to accomplish this in Azure?
Pls allow me to share my idea here.
creating app insights alert
enable app insights for azure vm
First, adding app insights to your application can made AI to capture your requests, dependencies, logs and some other messages, including calling API.
In my thoughts, I can log the response message of the API and set alert for some specific keywords. I created an azure function, and it will call MS graph API when triggered, and log the response. This function has integrated AI, so I created an alert by kql:
traces
| where timestamp > ago(30m) and message contains "xxx"
and set alert rule based on number of results greater than 0. When the alert was triggered, it will send email to my mailbox to mention me.
This means any time my API returned the response contains specific words, I will receive an email about it.

Filter Azure Application Insights requests by DNS

I have created an Application Insights resource in Azure and have it up and running.
I need to filter the data that is sent there so only data coming from a specific domain.
So, the application might be running in several places, like test and prod but I only want the logs from some of these domains.
What's the best implementation using Azure to filter all the possible requests from other domains that could "try" to send info there?
Once it was already sent to AppInsights, you cannot remove it anymore. You can only filter it out in queries so that it is not shown, but it will be stored in the underlying datastore until the TTL expires.
If you do not want the data there, you need to filter it out on the sending side - or just not send it in the first place. So why don't you simply remove the instrumentation key from your non-prod environments?!
The better solution, however, would be to have separate AppInsights instances for each env.

setting alert on custom metric in Application Insights

I need to set an alert on custom metric in Application Insights. For testing, I sent custom metric from a console app and then in Azure portal, set the alert on that custom metric. but when we will move the app to production, how we can make it work. I assume , during installation, we will need to set the alerts but I will be sending the custom metric through my application, so how I will set alert on that metric in the beginning which does not exists yet.
There's a current limitation that you have to send a value for the metric at least once, to cause it to be a "known" / "valid" metric name to create an alert for.
John is correct. This is a desired behavior aimed at preventing customers from making an error when specifying the name of a metric and thus configuring and relying on an alert that will never fire.

Questions about Azure resource management portal

I've recently been playing around with the Bing's image search api, however I have a concern I hope to resolve.
It is to do with the limit on the number of api requests that are allowed per month. After doing some reading it seems like if I were to exceed this limit, my Azure account would be billed depending on the number of api calls I have gone over my limit. Is it possible to set up some kind of alert through the Azure management portal that will stop the api from processing any more calls once a specific threshold has been passed?
If anyone has any experience using the Search api and can enlighten me, that would be great.
Try Metrics Monitoring. Go to the service within Azure Portal, Scroll Down to Monitoring -> Metrics and then click Add Metric Alert.
You can create an alert based on the number of successful calls or total calls and the alert can notify you via e-mail. Additionally, if you want to take action automatically after reaching the threshold, you can use Webhooks to make a call out to a web application or Azure Automation Runbook to automatically run PowerShell scripts or some code to prevent overuse. You can also use Logic Apps for that. Check the following link for further details and examples at the end of the page:
https://learn.microsoft.com/en-us/azure/monitoring-and-diagnostics/insights-webhooks-alerts

Resources