Add the ability to alert based on Analytics query
Current alert options only work with metrics.
Provide a simple alert mechanism based on any Analytics query. This could be as simple as requiring a custom query that returns two values: Filter Column and Filter Count.
Here is an example:
Query returns number of times a certain event/error code is returned along with a cloud_RoleInstance name. You limit your query based on whatever where conditions you want (timespan, customDimension, etc.)
When you set up the alert, you
1. pick the shared query. Some quick validation is done that correct fields are returned.
2. You can then set a threshold if the count is greater than x. Timespan would not be used.
This would make alerting considerably more useful for the way we expect our customers to use it.
Curtis Swartzentruber commented
Certainly there are other ways to achieve this, but if they are going to expose an alerting method directly in App Insights the current implementation seems half-baked.
Another option is to run continuous export to Log Analytics and alert from there. We proved this out and it works (the alerting options in Log Analytics are far superior). But then you are paying extra to send data over there beyond what you are already paying for App Insights. So I still feel like adding this would make the App Insights alert feature much more useful.
I voted for this but then revoked my vote when I found something similar. You can set up export a Shared Query as a URL (https://feedback.azure.com/forums/357324-application-insights/suggestions/13739847-add-ability-to-share-queries-via-url) and then set up an alert calling that URL (https://docs.microsoft.com/en-us/azure/application-insights/app-insights-tutorial-alert) and validate on the result (I haven't tested this)
Eric Dupuis commented
There is currently a preview feature named "Scheduled Analytics" somewhat available that promises to solve this need. I wish the VSAI team were more responsive on this feature and more details were available for it. I've tried to get more details on it and implement it since April 2017 with little success.