> ## Documentation Index
> Fetch the complete documentation index at: https://elementary-ele-2784-fix-alerts-configuration-links-docs.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Elementary dbt package models

## Run results

### dbt\_run\_results

*Incremental model*

Run results of dbt invocations, inserted at the end of each invocation.
Each row is the invocation result of a single resource (model, test, snapshot, etc).
New data is loaded to this model on an on-run-end hook named `elementary.upload_run_results` from each invocation that
produces a result object.

### dbt\_invocations

*Incremental model*

Attributes associated with each dbt invocation, inserted at the end of each invocation.
Each row is the result of a single invocation (dbt run, dbt test, dbt build, etc).
New data is loaded to this model on an on-run-end hook named `elementary.upload_dbt_invocation`.
It also contains information about your job or what triggered the invocation such as `pull_request_id`, `git_sha`, or `cause`.
If you're using an orchestrator that Elementary natively supports such as dbt Cloud or GitHub Actions,
this data is automatically populated, otherwise, you can populate it by using environment variables in the form of `DBT_<COLUMN_NAME>`.
For instance, adding `DBT_JOB_NAME` will populate `dbt_invocations.job_name` with the value of the environment variable.

### model\_run\_results

*View*

Run results of dbt models, enriched with models metadata.
Each row is the result of a single model.
This is a view that joins data from `dbt_run_results` and `dbt_models`.

### snapshot\_run\_results

*View*

Run results of dbt snapshots, enriched with snapshots metadata.
Each row is the result of a single snapshot.
This is a view that joins data from `dbt_run_results` and `dbt_snapshots`.

### job\_run\_results

*View*

Run results of dbt invocations, enriched with jobs metadata.
Each row is the result of a single job.
This is a view on `dbt_invocations`.

### elementary\_test\_results

*Incremental model*

Run results of all dbt tests, with fields and metadata needed to produce
the [Elementary report](/features/data-observability-dashboard).
Each row is the result of a single test, including native dbt tests, packages tests and elementary tests.
New data is loaded to this model on an on-run-end hook named `elementary.handle_tests_results`.

## dbt artifacts

The dbt artifacts models are created as empty tables, and a post-hook macro inserts data from the dbt graph object to
the table.
**Each time the model is executed, the data is replaced with the project’s current graph.**
It is recommended to execute these models every time a change is merged to the project.

### dbt\_models

*Table*

Metadata about all the models in the project and project packages.
Each row contains information about the properties of a single model, including columns like tags, owner,
materialization, depends\_on, and description.

### dbt\_tests

*Table*

Metadata about all the tests in the project and project packages.
Each row contains information about the properties of a single test, including columns like severity, parent model
unique id, tags and owner of the parent model, test params, and the test compiled query.

### dbt\_sources

*Table*

Metadata about the sources configured in the project and project packages.
Each row contains information about the properties of a single source, including columns like tags, owner, freshness
configuration, database and schema.

### dbt\_exposures

*Table*

Metadata about the exposures configured in the project and project packages.
Each row contains information about the properties of a single exposure, including columns like tags, owner, url and
depends on.

### dbt\_metrics

*Table*

Metadata about the metrics configured in the project and project packages.
Each row contains information about the properties of a single metric, including columns like tags, owner, sql, and
depends on.

### dbt\_snapshots

*Table*

Metadata about all the snapshots in the project and project packages.
Each row contains information about the properties of a single snapshot, including columns like tags, owner, depends\_on,
and description.

## Alerts views

### alerts\_dbt\_models

*View*

A view that is used by the Elementary CLI to generate models alerts, including all the fields the alert will include
such as owner, tags, error message, etc.
It joins data about models and snapshots run results, and filters alerts according to configuration.

### alerts\_dbt\_tests

*View*

A view that is used by the Elementary CLI to generate dbt tests alerts, including all the fields the alert will include
such as owner, tags, error message, etc.
This view includes data about all dbt tests except elementary tests.
It filters alerts according to configuration.

### alerts\_anomaly\_detection

*View*

A view that is used by the Elementary CLI to generate alerts on data anomalies detected using the elementary anomaly
detection tests.
The view filters alerts according to configuration.

### alerts\_schema\_changes

*View*

A view that is used by the Elementary CLI to generate alerts on schema changes detected using elementary tests.
The view filters alerts according to configuration.

## Anomaly detection

### data\_monitoring\_metrics

*Incremental model*

Elementary anomaly detection tests monitor metrics such as volume, freshness and data quality metrics.
This incremental table is used to store the metrics over time.
On each anomaly detection test, the test queries this table for historical metrics, and compares to the latest values.
The table is updated with new metrics on the on-run-end named `handle_test_results` that is executed at the end of dbt
test invocations.

### metrics\_anomaly\_score

*View*

This is a view on `data_monitoring_metrics` that runs the same query the anomaly detection tests run to calculate
anomaly scores.
The purpose of this view is to provide visibility to the results of anomaly detection tests.

### anomaly\_threshold\_sensitivity

*View*

This is a view on `metrics_anomaly_score` that calculates if values of metrics from the latest runs would have been
considered anomalies in different anomaly scores.
This can help you decide if there is a need to adjust the `anomaly_score_threshold`.

### monitors\_runs

*View*

This is a view on `data_monitoring_metrics` that is used to determine when a specific anomaly detection test was last
executed.
Each anomaly detection test queries this view to decide on a start time for collecting metrics.

## Schema changes

### schema\_columns\_snapshot

*Incremental model*

Stores the schema details for tables that are monitored with elementary schema changes test.
In order to compare current schema to previous state, we must store the previous state.
The data is from a view that queries the data warehouse information schema.
