# Monitors

Monitors in Sling observe your data assets without moving data. They track schema drift, data freshness, row counts, column-level statistics, and anomalies — giving you continuous visibility into the health and quality of your database tables and views.

![monitor-charts](/files/0ueIG4gWEufUMqQtvPTc)

## What Can Monitors Do?

* **Schema change detection** — Track when tables, columns, or types are added, dropped, or altered
* **Data freshness** — Alert when data falls behind its expected update schedule
* **Row count tracking** — Monitor table sizes and detect unexpected growth or shrinkage
* **Column statistics** — Collect min/max/mean, percentiles, null counts, cardinality, and more
* **Value validation** — Enforce regex patterns, accepted values, and rejected values on columns
* **Anomaly detection** — Automatically detect spikes, drops, and pattern changes using z-score analysis

## Quick Start

Create a YAML file that specifies which connection to monitor and what to track:

```yaml
connection: MY_POSTGRES

defaults:
  metadata: true
  row_count: true

objects:
  # monitor all objects in schemas
  marketing.*:
  salesforce.*:

  public.users:
    freshness_column: updated_at
    freshness_threshold: "24h"
    columns:
      email:
        count_distinct: true

  public.orders:
    freshness_column: created_at
    freshness_threshold: "12h"
```

On the Sling Platform, save this file in the `monitors/` directory of your project and schedule it as a job.

{% hint style="success" %}
Monitors are a [Sling Platform](/sling-platform/platform.md) feature available on the **Advanced plan**. See [Pricing](https://slingdata.io/platform/) for details.
{% endhint %}

## Configuration Overview

A monitor configuration has five top-level keys:

| Key          | Required | Description                                                                                                                         |
| ------------ | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `connection` | Yes      | The connection to monitor (must match a connection in `env.yaml`)                                                                   |
| `defaults`   | No       | Default settings applied to all objects. See [Structure](/sling-platform/platform/monitors/structure.md).                           |
| `objects`    | Yes      | Map of object names or patterns to their monitoring configuration. See [Structure](/sling-platform/platform/monitors/structure.md). |
| `schemata`   | No       | Schema change detection settings. See [Schema Changes](/sling-platform/platform/monitors/schema-changes.md).                        |

For the complete YAML reference, see [Structure](/sling-platform/platform/monitors/structure.md).

## Running Monitors

Monitor files are stored in the `monitors/` directory of your project on the Sling Platform. Once created, you can schedule them as jobs with a cron expression for automated execution. Monitor runs process objects in parallel (default 2 threads) and retry transient errors up to 3 times.

## Supported Connections

### Databases

| Database        | Table Size | Percentiles  | Freshness |
| --------------- | ---------- | ------------ | --------- |
| PostgreSQL      | Yes        | Yes          | Yes       |
| MySQL / MariaDB | Yes        | —            | Yes       |
| Snowflake       | Yes        | Yes          | Yes       |
| BigQuery        | Yes        | Yes (approx) | Yes       |
| ClickHouse      | Yes        | Yes          | Yes       |
| DuckDB          | Yes        | Yes          | Yes       |
| SQL Server      | Yes        | Yes          | Yes       |
| Oracle          | Yes        | Yes          | Yes       |
| Redshift        | Yes        | Yes          | Yes       |
| Databricks      | Yes        | Yes          | Yes       |
| Trino / Athena  | Yes        | Yes          | Yes       |
| SQLite / D1     | —          | —            | Yes       |

## Notifications

{% hint style="info" %}
Notification settings are a Sling Platform feature, configured per monitor job.
{% endhint %}

![monitor-notification](/files/bvpPYxFM9JGp1F57TzO9)

Each monitor job supports four notification triggers:

| Setting              | Fires When                                                   |
| -------------------- | ------------------------------------------------------------ |
| **On Schema Change** | Tables, columns, or types are added, dropped, or altered     |
| **On Freshness**     | Data exceeds its freshness threshold                         |
| **On Anomaly**       | Metric values deviate significantly from historical baseline |
| **On Failure**       | Monitor execution fails                                      |

Notifications can be sent via **email**, **Slack**, **Discord**, or **Microsoft Teams**.

## Learn More

Detailed documentation for each aspect of monitors:

* [Structure](/sling-platform/platform/monitors/structure.md) — Complete YAML reference, wildcards, defaults, and definition order
* [Object Metrics & Freshness](/sling-platform/platform/monitors/object-metrics.md) — Object-level metrics and data staleness detection
* [Column Metrics & Validation](/sling-platform/platform/monitors/column-metrics.md) — Column statistics and value validation rules
* [Anomaly Detection](/sling-platform/platform/monitors/anomaly-detection.md) — Z-score analysis, configuration, and event types
* [Schema Changes](/sling-platform/platform/monitors/schema-changes.md) — Schema drift detection and change events


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.slingdata.io/sling-platform/platform/monitors.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
