Managing Space: Monitor Postgres Table Size¶
Customer Managed Applies to customer-managed instances of Alation
Applies from version 2021.4
Alation can monitor the size of the internal Postgres tables relative to the available disk space. When the size of the tables that are monitored nears a critical threshold, Alation will send out email alerts to all Server Admins of the instance.
By default, Alation monitors one table, data_storage_blobaccesspostgres, which stores query results of queries executed in Compose. This table tends to grow over time as it stores each individual result. Increase in the size of this table is proportional to the number of queries run by users in Compose. According to the default settings, Alation runs the table size check daily and will send out alerts if the data_storage_blobaccesspostgres table reaches 80% of the space of the /data drive.
More tables can be added to the list of tables monitored for their size if needed.
The list of tables, thresholds, and alerts can be configured using a group of dedicated parameters in alation_conf.
See the table below for a summary of all the parameters:
|
|
Enables or disables the table size check on the Alation server. |
Default: |
|
|
Minute of the hour for which the table size check is scheduled, in Cron syntax. |
Value range is from Default:
|
|
|
Hour of the day for which the table size check is in Cron syntax. |
Value range is from Default:
|
|
|
Day of the week on which the table size check is to run, in Cron syntax. |
Value range is from
Default: * * means all days. The check runs daily at the scheduled time. |
|
|
A percentage threshold value which, when
set, is used to validate if any of the
tables listed in |
Value range is Default: The check is performed if the value is >
Email alerts will be sent to Server Admins if any single table breaches the threshold. |
|
|
A numeric threshold value in megabytes
which, when set, will validate if any of
the tables listed in
|
Value is number of megabytes Default:
The check is performed if the value is >
> Email alerts will be sent to Server Admins if any single table breaches the threshold. |
|
|
A percentage value, which, when set, will validate if the total size of all monitored tables goes beyond the set percentage limit of disk size. |
Value is in percent, Default: The check is performed if the value is
> Email alerts will be sent to Server Admins if the threshold is breached |
|
|
Comma-separated list of table names to monitor |
Defaults to one table: data_storage_blobaccesspostgres |
Disable or Enable Table Size Monitoring¶
Use the parameter alation.monitor_pg_disk_usage.enabled
to disable or enable the table size check on the Alation server:
SSH to the Alation host.
Enter the Alation shell:
sudo /etc/init.d/alation shell
Using alation_conf, set the value to
False
to disable or toTrue
to enable the check:alation_conf alation.monitor_pg_disk_usage.enabled -s False
Restart the Celery component:
alation_supervisor restart celery:*
Note
Restarting the Celery component will make the Alation UI unavailable for a few seconds. If this action is performed when users are actively using the Alation UI, they may notice the short pause. Users will need to refresh their browser page after the Celery restart is complete.
Customize the Schedule of the Table Size Check¶
To customize the schedule of the table size check, use the parameters:
alation.monitor_pg_disk_usage.check.in_day_of_the_week
alation.monitor_pg_disk_usage.check.in_hours
alation.monitor_pg_disk_usage.check.in_minutes
By default, the schedule is set to daily at 00:00 AM.
Example¶
To configure the table size check to run every Saturday at 3:55 PM, an admin needs to perform the following steps:
SSH to the Alation host
Enter the Alation shell:
sudo /etc/init.d/alation shell
Use alation_conf to set the following values:
To set the day of the week to Saturday:
alation_conf alation.monitor_pg_disk_usage.check.in_day_of_the_week -s 6
To set the hour of the day to 3 PM:
alation_conf alation.monitor_pg_disk_usage.check.in_hours -s 15
To set the minute of the hour to 55:
alation_conf alation.monitor_pg_disk_usage.check.in_minutes -s 55
No restart of Alation services is required.
Set the Table Size Thresholds¶
Use the following three parameters to set space thresholds for monitoring:
alation.monitor_pg_disk_usage.threshold.table_size_percent_of_free_space
alation.monitor_pg_disk_usage.threshold.table_size_in_mb
alation.monitor_pg_disk_usage.threshold.aggregated_table_size_percentage
You can set one or all of these parameters. If all parameters are set, the check will calculate the result based on each of the thresholds. If a threshold is breached, Server Admins will receive a separate alert about each of the specified thresholds.
To set a threshold:
SSH to the Alation host.
Enter the Alation shell:
sudo /etc/init.d/alation shell
Use the alation_conf command to set the required threshold, for example:
alation_conf alation.monitor_pg_disk_usage.threshold.table_size_percent_of_free_space -s 50
No restart of Alation services is required.