Alert system tables reference
This system table is in Public Preview.
This page includes information on the alert system tables, including an outline of each table's schema. Use these tables to query your workspace alerts and their evaluation history directly in SQL, so you can audit alert definitions, analyze evaluation trends, and monitor alert workloads at scale.
The system.alert schema contains two tables:
system.alert.alerts: The configuration of every alert, including its definition, schedule, evaluation thresholds, subscribers, and lifecycle timestamps.system.alert.alert_evaluation_history: One row per alert evaluation, capturing the evaluated state, result values, notification delivery status, and error details.
Requirements
By default, only users with both the account admin and metastore admin roles have access to the alert system tables. To share a table's data with a user or group, Databricks recommends creating a dynamic view for each user or group. See Create a dynamic view.
Alert configuration table schema
The system.alert.alerts table is a slow-changing dimension table. Each row captures the configuration of an alert at a point in time, so a single alert has multiple rows when its configuration changes.
Table path: This system table is located at system.alert.alerts.
The system.alert.alerts table uses the following schema:
Column name | Data type | Description | Example |
|---|---|---|---|
| string | The ID of the account. |
|
| string | The ID of the workspace where the alert is defined. |
|
| string | The ID of the alert. |
|
| string | The display name of the alert. |
|
| string | The username of the alert owner. Set to |
|
| struct | A struct that represents the compute resource attached to the alert. The |
|
| string | The ID of the user or Databricks service principal whose credentials are used to run the alert. |
|
| struct | A struct that represents the alert's schedule, including its pause status, cron schedule, and time zone. |
|
| struct | A struct that represents the source column from the query result used to evaluate the alert, including the aggregation applied to it. |
|
| string | The operator used to compare the source value against the threshold during evaluation. For example: |
|
| struct | A struct that represents the threshold the source value is compared against. The threshold is either a static value or another column. |
|
| string | The state the alert reports when the query returns an empty result. Possible values are |
|
| boolean | Whether to notify subscribers when the alert returns to the |
|
| int | The number of seconds the alert waits after being triggered before it can trigger again. If |
|
| array | An array of the subscribers that receive the alert notification. Each subscriber is identified by a user email or a notification destination ID. |
|
| timestamp | The time the configuration was last changed. Time zone information is recorded at the end of the value with |
|
| timestamp | The time the alert was created. Time zone information is recorded at the end of the value with |
|
| timestamp | The time the alert was permanently deleted. Alerts moved to trash are not recorded. Time zone information is recorded at the end of the value with |
|
Alert evaluation history table schema
The system.alert.alert_evaluation_history table records one row for each alert evaluation, capturing the evaluated state and related statistics.
Table path: This system table is located at system.alert.alert_evaluation_history.
The system.alert.alert_evaluation_history table uses the following schema:
Column name | Data type | Description | Example |
|---|---|---|---|
| string | The ID of the account. |
|
| string | The ID of the workspace where the alert is defined. |
|
| string | The ID of the evaluated alert. Joins to |
|
| string | The ID of the job that ran the alert. Joins to |
|
| string | The reference key for the task within the job. Joins to |
|
| string | The ID of the alert evaluation run. |
|
| string | The evaluated state of the alert. Possible values are |
|
| struct | A struct that represents the source value produced by the evaluation. |
|
| struct | A struct that represents the threshold value from the evaluation, or the static value set in the alert configuration. |
|
| string | The error code if the evaluation failed with an error. |
|
| string | The user-visible error message if the evaluation failed with an error. |
|
| array | An array of the subscribers that were successfully notified. Each subscriber is identified by a user email or a notification destination ID. |
|
| array | An array of the subscribers whose notifications failed to send. Each subscriber is identified by a user email or a notification destination ID. |
|
| timestamp | The time the evaluation started. Time zone information is recorded at the end of the value with |
|
| timestamp | The time the evaluation ended. Time zone information is recorded at the end of the value with |
|
Sample queries
The following sample queries show common ways to analyze alert configuration and evaluation history. Each query uses named parameter markers for the alert and workspace IDs, so you're prompted for the values when you run the query.
Find the most recent evaluation for an alert
This query returns the latest configuration of a specific alert alongside its most recent evaluation.
SELECT
c.alert_id,
c.display_name,
c.compute,
c.schedule.quartz_cron_schedule AS schedule,
c.evaluation_comparison_operator AS operator,
c.evaluation_threshold.value.double_value AS threshold,
c.change_time AS config_last_updated,
e.evaluated_state,
e.start_time AS evaluation_time,
e.end_time,
TIMESTAMPDIFF(SECOND, e.start_time, e.end_time) AS eval_duration_seconds
FROM (
SELECT *
FROM system.alert.alerts
WHERE alert_id = :your_alert_id
AND delete_time IS NULL
ORDER BY change_time DESC
LIMIT 1
) c
LEFT JOIN (
SELECT *
FROM system.alert.alert_evaluation_history
WHERE alert_id = :your_alert_id
ORDER BY start_time DESC
LIMIT 1
) e ON TRUE;
Find which alerts triggered most in the last seven days
This query counts how many times each alert triggered in a workspace over the last seven days.
SELECT
alert_id,
COUNT(*) AS trigger_count_7d
FROM system.alert.alert_evaluation_history
WHERE workspace_id = :your_workspace_id
AND start_time >= CURRENT_DATE() - INTERVAL 7 DAY
AND evaluated_state = 'TRIGGERED'
GROUP BY alert_id
ORDER BY trigger_count_7d DESC;
Track how an alert's state changed over time
This query summarizes the daily count of each evaluated state for a specific alert over the last 30 days. Use it to build a dashboard that monitors alert reliability.
SELECT
DATE_TRUNC('day', start_time) AS eval_day,
COUNT_IF(evaluated_state = 'OK') AS ok_count,
COUNT_IF(evaluated_state = 'TRIGGERED') AS triggered_count,
COUNT_IF(evaluated_state = 'ERROR') AS error_count
FROM system.alert.alert_evaluation_history
WHERE alert_id = :your_alert_id
AND start_time >= CURRENT_DATE() - INTERVAL 30 DAY
GROUP BY 1
ORDER BY eval_day ASC;
List active alerts in a workspace
This query returns the latest configuration of each alert that is not deleted and not paused in a workspace.
WITH latest AS (
SELECT
*,
ROW_NUMBER() OVER (PARTITION BY alert_id ORDER BY change_time DESC) AS rn
FROM system.alert.alerts
WHERE workspace_id = :your_workspace_id
AND delete_time IS NULL
)
SELECT
alert_id,
display_name,
compute,
schedule.quartz_cron_schedule AS cron_schedule,
schedule.pause_status
FROM latest
WHERE rn = 1
AND schedule.pause_status != 'PAUSED';