.NET

Monitoring Dashboard

OmniDB has a cool feature called Monitoring Dashboard. We know a picture is worth a thousand words, so please take a look:

As you can see, this is a new kind of inner tab showing some charts and grids. This Monitoring inner tab is automatically opened once you expand the tree root node (the PostgreSQL node). You can keep it open or close it at any time. To open it again, right-click the root node and click on Dashboard.

The dashboard is composed of handy information rectangles called Monitoring Units. Here is an example of Monitoring Unit and its interface elements:

Types of Monitoring Units

There are 3 types of Monitoring Units:

Showing and hiding units in the dashboard

If you click in the button Refresh All, then all Monitoring Units will be refreshed at once. You can also remove undesired Monitoring Units by clicking in the Remove button. Let us go ahead and remove all units from the dashboard, making it empty:

The 17 units that come built into OmniDB (PostgreSQL and MySQL server metrics — transaction rate, backends, WAL production, database/table size, and so on) run as native code and need nothing extra installed in the database.

Now that our dashboard is empty, let us add some units. Click on the Manage Units button.

Click on the green action to add any of the built-in units — e.g. Backends and Database Size. Wait for some seconds and you will have a dashboard like this:

In a similar way, you can add and remove any unit you want to customize the dashboard the way you want.

Writing custom Monitoring Units

OmniDB lets you write your own units, or customize existing ones, by writing a single SQL query — the same connection and permissions your SQL editor already has, just running on a timer instead of on demand. There’s no separate scripting language or sandbox to learn.

Note: since the query re-runs unattended on a refresh interval, only SELECT (or WITH ... SELECT) queries are accepted — a destructive statement pasted in by mistake is rejected outright rather than silently firing on a timer.

To create a new Monitoring Unit, click on the Manage Units button in the dashboard, then click on the New Unit button. It will open a new kind of inner tab with a Name, a Type dropdown, a Refresh Interval, and a single SQL Query editor (plus a Chart Type dropdown, shown only for Chart units).

The query’s shape depends on the unit’s Type:

Write (or paste) the query into the SQL Query editor, then click the Test button to see it rendered in the preview drawing area — you can test as many times as you like. Once you’re happy with it, give the unit a name, set a refresh interval, and hit Save. Close the edit tab and the new unit appears in the unit list, ready to add to the dashboard (green action) just like a built-in one.