Azure Dasboards alert based on percentage - azure

In Azure dashboards, is there any way we can trigger alerts based on percentage instead of counts?.. Example if total total failures in 20 minutes is 20%, then trigger alert than just cheking the counts of the failures? Here setting the count is not meeting our requirement and looking a solution based on the Percentage of occurance.

Based on the above shared requirement , we have created the custom Kusto query to calculate the percentage of failure requests & to trigger an email alert notification if the failure requests percentage > 20% for a particular web app & also projecting the output of the Kusto query to the dashboard as well.
Here is the custom Kusto query :
requests
| where timestamp >= ago(6h)
| project success, ['id'], resultCode, appName
| summarize failedtotal = countif(success == 'False'), total= count()
| project failurepercentage = (100 * (failedtotal) / (total))
| summarize totalouputrows=countif(failurepercentage>20) by failurepercentage
Use the New alert rule option in the log analytics space to create a custom alert & using the above query as signal as shown in below picture.
Use the Pin to dashboard option in the log analytics work space to project the output of the custom Kusto query & create the dashboard accordingly.
Here is the sample image of the alert rule that was created using the above query.
Here is the sample email output & Kusto query output projected to dashboard triggered by above alert rule.

Related

Get list of "new alerts" for azure monitor

I have KQL giving me counts of my alert by severity the only issue is when the user closes them (i.e updates the user response) no column in the alerts table is updated
So here is the azure triggered view
but the alerts table has nothing
This strikes me as a fairly normal ask
I am making the following assumption that you have a custom KQL query for Azure Resource Graph Explorer to identify Azure Monitor alerts.
Properties, such as alertState and monitorCondition are not standalone columns, but are nested properties within the dynamically typed "properties" column. As this is querying Azure Resource Graph, the records are updated directly, rather than adding a new log (as it would be in log analytics).
Below is a query that extracts the two relevant properties.
alertsmanagementresources
| extend alertState = tostring(parse_json(properties.essentials.alertState))
| extend monitorCondition = tostring(parse_json(properties.essentials.monitorCondition))
| project name, alertState, monitorCondition
If you need help, please share your query and what information you are looking to query.
Alistair

Application Insights alert for no log is written

I try to create a azure alert rule which should be triggered in case my service do not log anything.
I created a query to check if my service logs something. This works fine until there are no logs in the specified time (e.g. give the provided query a filter criteria for the timestamp).
Query: customEvents | where name == 'ShouldBeLoged' | limit 1
This query will just give me the query result: No results found from the last 24 hours.
If create a alert of this query the alert view shows me this (see picture):
Has someone an idea how I could achieve that the alert is triggered in case the service do not log anything?
Follow the workaround to trigger the alert if the threshold value less than 1(Means no log written):
Here I am fetching the one Limit value of custom event.
Workaround follows
Create alert with threshold if it less than 1 mean it will fire the alert
Here the query we used to fetch the single custom event.
We fetch single custom event, so we check the threshold value is less than 2 (it will fire if the event values is less than 2).
Result

A chart with a single number using Kusto Query Language

I have a simple Kusto request, something like the following:
customMetrics
| where timestamp > ago(10m)
| where name == "Custom metric number one"
| summarize sum(value)
Obviously, the result of this query is a single number.
I would like to pin this request to a dashboard, so the tile will look like a card having a title/subtitle and the number retrieving as the result of the Kusto request. Firstly, I tried to use "render" operator, but it can draw either a chart or a simple unformatted table. I tried to use "render card", but ApplicationInsights answered that "We currently don't support 'card' visualization type."
Is there any other possibility to create the desired tile with a single number on it?
Why not just pin the table query result:
customMetrics
| where timestamp > ago(10m)
| where name == "Custom metric number one"
| summarize sum(value)
results in
It is probably the closest to a card you can do at the moment
There is another option as well, you can add a Markdown tile, it can point to a url containing Markdown content so you might be able to create something that periodically updates a certain MD file and show that on the dashboard. You can leverage the Application Insights API to get the value you want and have an azure function generate the markdown.
Another option, if you have access to Power Bi, is to create a Power Bi report that you share with external stakeholders/non developers.When going that direction you can use all the rich visuals Power Bi provides in combination with data from Application Insights, including cards. See the docs
Or use grafana? There’s a manager instance in azure albeit still in preview.

How to create a single data tile in azure application insight dashboard?

How to create a single data tile in azure application insight dashboard ?
by single data i mean the XXX(A number)(which i found querying the application insights).
For say - I queried for unique users in Application Insight logs, and I want to display it as Single Data Tile on the Dashboard. i.e. just the number(XXX) and the heading (Unique Users For XYZ Application)
Workbooks will give you tons of features to create custom tiles showing just the number on the tile. Here's how to do it using Workbooks.
Try the code below, then pin to dashboard:
requests
//add the filter for querying unique users
| extend users=""
| summarize number_of_users = count() by users
| render barchart
The result:

Realtime report in power BI

Is it possible to make real-time monitoring report by using Power BI?
I have an experience only with elasticsearch+kibana and I want to make the same dashboard by using Power BI:
There is a data source - RequestDateTime, Sendor, IsSuccess, RequestType, Request, Response. For example:
2016-10-20 12:00:12 | Test 1 | True | SetUserInfo | xml here... | xml here...
2016-10-20 12:00:18 | Test 2 | False | GetUserInfo | xml here... |
This data can be downloaded from Azure SQL database, by using simple sql-query.
I want to make a simple column chart. X-axis should be a timeline, accoring to the RequestDateTime field. Y-axis should be a count of records, that is correspond to filters.
Report should have a filters by sendor, isSuccess, RequestType and RequestDateTime range (for example - last 6 hours).
The report should be able to be refreshed in a real-time mode, according to the new events in the database.
The pipeline I usually do in my work using app.powerbi for real time visualization is :
Create a dataset: In your workspace, select the "create" option, there you can import or connect to data from Files and Databases. You can choose Azure SQL database and follow instructions.
Create a report: In your dataset list, select the icon to create a report (here you define the filters that you want) and save it.
Create a dashboard: Pin the charts to a dashboard. I have found that only dashboard refresh itself when data is added or deleted in the database, thus, you can see the real time in the dashboard.
You may find this video useful.

Resources