setting alert on custom metric in Application Insights - azure

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.

Related

Creating and Deploying Alert Rules Based on Custom Metric Fails

Let's say I have a custom metric on Azure Application Insights. These custom metric does not seem to exist until it receives the log/data with the metrics. So when I try to deploy alert rules that are based on these custom metrics, the Bicep deployment will fail saying the metric does not exist.
Is there a workaround to this issue? I would like to not have to send dummy data just to create the custom metric first. Or is there something I'm missing or doing wrong?

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.

How can we set an alert, in Azure Application Insight, If daily data volume limit is crossed?

I want to send an alert to application Insight specific user/users(Other then subscription administrator) when daily data volume limit is reached in application Insight.
The current answer: "Not right now"
From the team that owns this functionality:
We will be making this a proper metric that customers can use as a regular metric, then they can do any metric alerts and other scenarios they want to do (including SMS, etc.)
It’s on the backlog to fix this experience correctly.
so right now, no you can't alert on it.
subscription admins should be getting an email when you hit the cap, and if you go to the activity log for that application insights resource, you should be able to see an operational event for it:

Application Insights alerts for custom requests

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.

Resources