Osama
07/14/2025, 3:33 PMedr monitor --profiles-dir /tmp/elementary_profiles_hqilf7bf --filters statuses:warn --slack-webhook //:https%3A%2F%2Fhooks.slack.com%2Fservices%2FT<rest-of-the-url> --target-path /tmp/elementary_jobs_datahub_pipeline_send_elementary_alerts_task_scheduled__2025-07-12T22:15:00+00:00_x1y3d2b0/edr_output/jobs_datahub_pipeline_send_elementary_alerts_task_scheduled__2025-07-12T22:15:00+00:00 --project-dir /usr/local/airflow/dbt/jobs_datahub -t prod --env prod -d 5
However, I am not getting any alerts in slack and after investigation the ALERTS_V2 table is empty even though the non-passing data tests are visible in the DBT_RUN_RESULTS table that is created by Elementary. What could be the issue here?kapa.ai
07/14/2025, 3:33 PMkapa.ai
07/14/2025, 3:33 PMALERTS_V2 table and thus not being sent to Slack: ### 1. Elementary Models Not Refreshed or Materialized Incorrectly A common issue is that the Elementary models (such as alerts_v2, alerts_dbt_tests, etc.) are not being refreshed or are materialized incorrectly. If, for example, these models are materialized as tables instead of views, they may not be updated with each run, leading to empty alert tables even when there are failing or warning tests. This can happen if you have a global materialization setting in your dbt_project.yml like: yaml models: +materialized: table This would override the intended materialization for Elementary models. The solution is to remove or override this setting for the Elementary models and re-run dbt run -s elementary to recreate the models as views. This issue has been reported and resolved by other users in the community [Slack thread](https://slack.com/archives/C02CTC89LAX/p1697784304685269). ### 2. Required dbt Run/Test Sequence Elementary relies on the results of dbt test to populate its internal tables. The recommended sequence is: 1. dbt run -s elementary (to ensure Elementary's models/tables are created and up-to-date, especially after upgrades) 2. dbt test (to generate test results) 3. edr monitor ... (to process and send alerts) If you skip dbt run -s elementary after changing model materializations or upgrading the package, the necessary tables/views may not exist or be up-to-date, resulting in empty alert tables [Slack thread](https://slack.com/archives/C02CTC89LAX/p1686842159294479). ### 3. Disabled Alert Types in Configuration Check your dbt_project.yml for any variables that might disable WARN alerts, such as: yaml vars: disable_warn_alerts: true If this is set, Elementary will not generate alerts for warnings. Make sure this is not present or is set to false [Slack thread](https://slack.com/archives/C02CTC89LAX/p1681468420704779). ### 4. Filters and Days Back By default, Elementary only considers alerts from the last 24 hours. If your failing tests are older, you may need to increase the --days-back parameter (which you have set to 5, so this is likely not the issue, but worth double-checking the test timestamps) [Slack thread](https://slack.com/archives/C02CTC89LAX/p1709624407880629). ### 5. Data Location and Profile Consistency Ensure that the dbt test and edr monitor commands are using the same target database/schema and profile. If they are pointed at different locations, the test results will not be visible to Elementary [Slack thread](https://slack.com/archives/C02CTC89LAX/p1686842159294479). --- Summary of steps to resolve: 1. Check your dbt_project.yml for global materialization settings and override for Elementary models if needed. 2. Run dbt run -s elementary to recreate Elementary's models as views. 3. Run dbt test to generate new test results. 4. Run your edr monitor command. 5. Ensure no disable flags are set for warn alerts. 6. Confirm that all commands are using the same profile and target. If after these steps the ALERTS_V2 table is still empty, check the edr.log for errors and consider sharing it for further troubleshooting. For more details, see the relevant discussions: [Slack thread on materialization issue](https://slack.com/archives/C02CTC89LAX/p1697784304685269), [Slack thread on run sequence](https://slack.com/archives/C02CTC89LAX/p1686842159294479), and [Slack thread on disabling warn alerts](https://slack.com/archives/C02CTC89LAX/p1681468420704779).