45.2. Creating an Alert #
In the navigation panel, go to Monitoring → Alerts.
In the top-right corner of the page, click Create alert.
In Configuration, specify parameters of the new alert (parameters marked with an asterisk are required):
Name.
Priority.
Possible values:
Not classified (default)
Low
Medium
High
Critical
Data source type: The type of the data source that will be used for the alert trigger.
Currently, you can only use the Metrics type.
Data source.
State: The state of the alert after creation.
Possible values:
Disabled
Enabled
Check interval, sec.: The interval in seconds for checking the data source of the alert trigger.
Minimum and default value:
60.Flap check, count: The number of repeated triggers required for stopping the alert.
The value of
0means that this limitation is disabled.Default value:
3.Notify after, sec.: The time in seconds during which the trigger must continually fire for the alert to be sent.
The value must be greater or equal to the Check interval, sec. value.
Default value:
300.Cooldown period, sec.: The time in seconds during which the alert will not be sent after the last firing trigger.
0means that this limitation is disabled.Default value:
300.
Click Next.
In Rules and check objects, configure the rules to fire the alert trigger and select the objects to check (parameters marked with an asterisk are required):
Rules:
Metric name: The name of the metric without any additional characters, used for the alert trigger.
You can use the following pgpro-otel-collector metrics from the
monitoring.metricstable of the repository database:postgresql.archiver.archived_countpostgresql.archiver.failed_countpostgresql.bgwriter.buffers_checkpointpostgresql.bgwriter.buffers_cleanpostgresql.bgwriter.buffers_backendpostgresql.bgwriter.buffers_allocatedpostgresql.bgwriter.maxwritten_cleanpostgresql.bgwriter.buffers_backend_fsyncpostgresql.bgwriter.checkpoints_requestedpostgresql.bgwriter.checkpoints_timedpostgresql.bgwriter.checkpoint_sync_time_millisecondspostgresql.bgwriter.checkpoint_write_time_millisecondspostgresql.databases.blocks_hitpostgresql.databases.blocks_readpostgresql.databases.conflictspostgresql.databases.deadlockspostgresql.databases.checksum_failurespostgresql.databases.tuples_fetchedpostgresql.databases.tuples_returnedpostgresql.databases.tuples_insertedpostgresql.databases.tuples_updatedpostgresql.databases.tuples_deletedpostgresql.databases.temp_bytespostgresql.databases.temp_filespostgresql.wal.bytespostgresql.databases.rollbackssystem.cpu.utilizationsystem.memory.usagesystem.paging.usagepostgresql.wal.recordspostgresql.databases.commits
Operator • Threshold value: The alert condition containing a logical operator and value.
Possible logical operators:
= (eq)
> (gt)
>= (gte)
< (lt)
<= (lte)
!= (neq)
For example, if you select
>and specify0, the alert is sent when the value of the specified metric exceeds0.You can add multiple alert trigger rule conditions by clicking Add. A condition can be deleted by clicking
.
Rule condition: The logical connectives for the specified alert trigger rule conditions.
Possible values:
And
Or
This parameter is available only if you added multiple alert trigger rule conditions.
Objects to check: The objects to be checked against the configured rules.
Select one of the following object types:
Instances.
Clusters.
Tags.
Then select one or more objects from the Available list.
If no objects are selected, then the alert is configured to check all objects of the selected type.
Notification settings:
Notify users: The users that will receive alerts.
Notify groups: The user groups that will receive alerts.
Alert template: The template of the alert text.
You can use the following variables in the alert text:
{{.Title}}: The name of the metric used for the alert trigger.{{.Timestamp}}: The date and time when the alert trigger fired.{{.HostName}}: The name of the host where the trigger fired.{{.AgentName}}: The agent that caused the trigger to fire.{{.InstanceName}}: The name of the instance where the trigger fired.{{.Status}}: The status of the alert trigger.{{.ThresholdValue}}: The threshold value of the metric that caused the alert trigger to fire.{{.ActualValue}}: The actual value of the metric that caused the alert trigger to fire.{{.TargetValue}}: The type of the checked objects.{{.MetricName}}: The name of the metric.
Default alert template:
{{.Title}} [{{.Timestamp}}]: {{.HostName}} status is {{.Status}}Notify resolved: Specifies whether the alert is sent once the trigger is resolved.
Possible values:
Enabled.
For this value, in Resolved template, enter the template of the alert text.
You can use the same variables in this alert text as in Alert template.
Disabled.
Click Next.
In Confirmation, review the alert parameters.
Click Save.