> For the complete documentation index, see [llms.txt](https://docs.datasentinel.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datasentinel.io/manual/features/key-features/alerting.md).

# Alerting

Alerting watches your PostgreSQL instances and their servers, and notifies you by email, webhook or script when a rule is breached.

Alerting evaluates rules on the metrics of each instance, every minute. When a rule is breached, Datasentinel records a problem and notifies you. When the situation is back to normal, it records the recovery.

## How it works

{% stepper %}
{% step %}

### Rules

Each instance gets a set of rules from a [template](https://docs.datasentinel.io/manual/features/key-features/alerting/templates.md). A rule has a WARNING threshold, a CRITICAL threshold and, for most rules, a number of occurrences.
{% endstep %}

{% step %}

### Evaluation

Rules are evaluated every minute. A problem is raised when a threshold is exceeded for the number of consecutive minutes set by the occurrences.
{% endstep %}

{% step %}

### Notification

A **PROBLEM** notification is sent once, when the problem is raised. A **RECOVERY** notification is sent when the value is back under the WARNING threshold.
{% endstep %}
{% endstepper %}

Notifications can be sent in three ways, alone or together:

* Email
* Webhook
* Custom script

{% hint style="info" %}
A custom script lets you forward the notifications to an external monitoring or ticketing system.
{% endhint %}

Problems are also visible in the interface, with or without notification: on the dashboards, in the notification lists, and as annotations on the charts.

## What is monitored

| Area       | Rules                                                                                                                                                 |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| PostgreSQL | Instance status, max connections, blocked sessions, sessions consuming CPU, WAL files, WAL file system, archiving delay and failures, replication lag |
| System     | CPU usage, load average, memory usage, swap usage, file systems                                                                                       |

## Set up alerting

Alerting is turned off by default. Follow these four pages in order.

| Step | Page                                                                                         | What you do                                            |
| ---- | -------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| 1    | [Settings](https://docs.datasentinel.io/manual/features/key-features/alerting/settings.md)   | Turn alerting on and choose how notifications are sent |
| 2    | [Templates](https://docs.datasentinel.io/manual/features/key-features/alerting/templates.md) | Define the rules and the instances they apply to       |
| 3    | [Silences](https://docs.datasentinel.io/manual/features/key-features/alerting/silences.md)   | Suspend alerting during maintenance                    |
| 4    | [Manager](https://docs.datasentinel.io/manual/features/key-features/alerting/manager.md)     | Follow, acknowledge and review the problems            |

{% content-ref url="/pages/nXvBofbtmzI9OvgTevcA" %}
[Settings](https://docs.datasentinel.io/manual/features/key-features/alerting/settings.md)
{% endcontent-ref %}

{% content-ref url="/pages/sTY3ucePBgzTC1I91qUF" %}
[Templates](https://docs.datasentinel.io/manual/features/key-features/alerting/templates.md)
{% endcontent-ref %}

{% content-ref url="/pages/xNzl900jwsUAaqKNLAFI" %}
[Silences](https://docs.datasentinel.io/manual/features/key-features/alerting/silences.md)
{% endcontent-ref %}

{% content-ref url="/pages/4mlH4lpYt2K0kfaITBbv" %}
[Manager](https://docs.datasentinel.io/manual/features/key-features/alerting/manager.md)
{% endcontent-ref %}

The [Alerting API](https://docs.datasentinel.io/manual/implementation/platform-usage/api-reference/alerting.md) lets you enable or disable alerting for an instance, list its problems and create customized alerts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.datasentinel.io/manual/features/key-features/alerting.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
