Introduction
An OIC customer wants to be informed, when an OIC instance aborts. This leads on from one of my recent posts on monitoring aborted instances. Please recognise the difference between flows that fail due to errors and those that abort. Here we are concerned purely with the latter.
I covered the creation of an OIC Errors Dashboard in the previous post. It contained the following widget, among many others -
 
Alarms in OCI Log Analytics
I begin with the activity stream log in Log Analytics. I can access this via Administration - Sources - 
and then click on Labels - Add Conditional Label -
As you can see, I added the following - 
Here I specified my own metric namespace, resource group and name. Also note the dimensions I have included. Here I added Integration, Identifier and Project Id.
The context sensitive menu for my detection rules contains the following option - Create Alarm, which I click.
new-oic-instance-aborted-metric[5m]
{rule_ocid = "ocid1.loganalyticsingesttimerule.myOcIDg
"}.grouping().sum()
This I amend to - 
new-oic-instance-aborted-metric[1m]{rule_ocid = "ocid1.loganalyticsingesttimerule.myOCID", Integration =~ "*", Identifier =~ "*", Project_ID =~ "*"}.sum() > 0
I need to include the dimensions, so they will be added to the alarm email.
I complete the Alarm, giving it a name etc. -
Let's test it out. I'll run an async integration and then abort it.
Summa Summarum
This is an excellent feature in Log Analytics and a BIG thank you to my esteemed colleague Varun K., for pointing this out to me. You can, of course, extrapolate from this and create other alarms, based on whatever conditions you want. Remember the conditional label I created? It's really as simple as that.
 

No comments:
Post a Comment