Monday, April 24, 2023
Let me introduce you to APE Watchtower—the alarm system for your APEX Applications which will help you sleep better without worries.
It’s like a smart home installation but for your IT solutions. Like installing motion detectors in your rooms, you set up APE Sensors that monitor your applications, database, external services, or even business processes. And if they detect something shady, Watchtower raises the alarms.
Sensors are configured in two steps.
1. The sensor logic
The sensor logic is defined in the form of a SQL query which should return the current state of what you would like to monitor. The statement should have a “Key” column returning a unique identifier for each returned row and a “Value” column, returning a numerical recording.
Let’s take a very basic example – Monitoring the number of errors for each of your applications in the last 24 hours. This is what the SQL statement would look like:
The statement will return one row for each application that had any activity in the last 24 hours with the number of raised exceptions. We use the application ID for the key value, the number of errors as the recorded value, and the application name for attribute_01, which we can later use as a substitution string.
2. Escalation rules
The Sensors escalation rules define how the recorded value is interpreted and how Watchtower should react. This is done by defining recorded value ranges for the available severity levels:
By using the # syntax, you can use column substitution strings to dynamically build the messages that are communicated to you.
For each severity level, escalation channels are configured to control when and how abnormal behaviors are communicated. Watchtower comes with the prebuilt APE Inbox and APEX Email escalation channels. Still, you can easily configure your own by calling database procedures that send an SMS or raise your home security alarm by calling the right API. I might have exaggerated with the last one, but it’s technically possible 😊
The snooze option helps you control how often the escalation is triggered to prevent your mailbox from being spammed.
The sensor’s logic and escalation rules are not executed by themselves. They have to be attached to a scanner. A scanner is a monitoring schedule using scheduler jobs similar to APEX Automations. It comes down to how up-to-date you want your recording to be. If you want alerts to go off as soon as possible, attach them to a very frequently running scanner.
For each scan, you can explore which sensors recorded readings, what was recorded, and if any escalation channels were triggered:
As all well-known smart home systems come with a central dashboard, it’s the same with Watchtower.
The dashboard allows you two configure any number of traffic lights which represent the latest recorded value per sensor:
Trend charts display recorded values over a configurable timeline for a sensor. They are useful if sensors measure the time elapsed as an APEX request or Scheduler Job run.
The sensor/day matrix is a comprehensive overview by sensor and time to keep a great overview of what is going on in your house ... Sorry, I meant applications 😊
Well, you can monitor anything that is running or accessible through your Oracle Database.
By using the APEX activity logs, you can:
Use the database dictionary views to:
Keep an eye on your external services by:
Don’t limit yourself to technical parameters - use Watchtower also for your processes:
As you can see, Watchtower is applicable in countless scenarios; you have to find the right inspiration. And to help you with that, APE ships a couple of sensors to get you started. After installing APE, check the dashboard and your APEX Inbox for the results:
The whole idea around APE Watchtower is to do the monitoring for you. You don’t have to scroll through different logs and charts trying to find some abnormalities in your solutions because Watchtower will bring them to your attention. Of course, you must set up all the sensors and finetune when and how they alert you, just like trying to position your motion detectors at home to cover the right angles so your dog does not trigger them.
After that, your alert system is armed, and you can focus on your everyday tasks.
No comments yet, be the first one to let us know what you think of this article!