Our slack alerts contains very little to almost no...
# ask-elementary-ai
c
Our slack alerts contains very little to almost no information, i want them to be more descriptive and containing more context. Typical error alert:
Copy code
Elementary  3:34 PM

Error: fct_sales_ticks: 1 issues detected
Powered by Elementary
 Model Errors: 1 | Env: prod
 Details
Tags
No tags
Owners
bumblebi
Subscribers
No subscribers
Model Errors
 dbt failed to build table "fct_sales_ticks" - Owners: bumblebi
See less
Typical warning alert:
Copy code
Warning: fct_tenant_salary_sie_import: 1 issues detected
Powered by Elementary
 Test Warnings: 1 | Env: prod
 Details
Tags
No tags
Owners
signal
Subscribers
No subscribers
Test Warnings
 "unique" test failed on fnx-analytics-core-prod.facts.fct_tenant_salary_sie_import.salary_sie_import_id - Owners: signal
See less
How can we make them contain more information?
k
Looking at your alerts, it appears they are using the grouped alerts format (
slack_group_alerts_by: table
), which intentionally contains less information per issue. Here's how to get more detailed alerts: 1. Switch to Non-Grouped Alerts If you're using
slack_group_alerts_by: table
in your config or
--group-by table
in your CLI command, remove it. Regular (non-grouped) alerts include all fields by default. [Slack thread] 2. Configure
alert_fields
to Include More Context
You can explicitly specify which fields to show in alerts using the
alert_fields
property. Set this globally in your
dbt_project.yml
so it applies to all tests:
Copy code
models:
  my_project:
    +meta:
      alert_fields: ["table", "column", "tags", "owners", "subscribers", "description", "result_message", "test_results_sample"]
Or under the
tests
key:
Copy code
tests:
  my_project:
    +meta:
      alert_fields: ["table", "column", "owners", "result_message", "test_results_sample"]
[OSS Alerts Configuration] 3. Add Descriptions to Your Tests Adding a
description
to your tests provides business context directly in the alert, which is especially useful for stakeholders:
Copy code
data_tests:
  - unique:
      config:
        meta:
          description: "This test ensures that salary_sie_import_id is unique. A failure means duplicate records exist."
[OSS Alerts Configuration] 4. Add Owners and Tags Make sure your models and tests have
owner
and
tags
configured so that context is always present in alerts:
Copy code
models:
  - name: fct_sales_ticks
    config:
      meta:
        owner: "@your.name"
    tags: ["#data_ops", "#sales"]
[OSS Alerts Configuration] ------------------------- Note on configuration priority: For tests, Elementary applies config in this order: test properties →
tests
key in
dbt_project.yml
→ parent model config. Setting it at the project level is the most efficient way to apply it broadly without repeating it for every test. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.
c
what does the test_results_sample show more in perticular? Is it necessary @kapa.ai
k
Sorry @Christopher Ekfeldt, I'm not sure what you mean. Please try again. šŸ‘‹
What is
test_results_sample
?
test_results_sample
is an alert field that displays a sample of the actual failing rows from a failed test. When a test fails, Elementary captures a small set of the rows that caused the failure and stores them in the
test_result_rows
table. This sample is then surfaced directly in your Slack alert so you can immediately see which data is problematic without having to run queries manually. [Test Result Samples] By default, Elementary saves 5 sample rows per failed test, but this is configurable. [Test Result Samples] How it's displayed As of v0.17.0, the sample is shown as a table block in Slack (rather than a list of JSON/dicts), but only under these conditions: • The test is not an anomaly test • The sample has 4 or fewer columns If the sample has more than 4 columns, it falls back to JSON format. [Slack thread] ------------------------- Is it necessary? It depends on your use case: • For technical users: It's very helpful for quick triage — you can see the bad rows immediately without querying the warehouse yourself. • For non-technical users: It can be essential if they have no other way to access the data (e.g., seeing which specific records failed a business rule). • If you have PII/sensitive data: You may want to disable it for those tables to avoid exposing raw data in Slack. [Security and Privacy] You can disable it globally or per-test:
Copy code
# Disable globally
vars:
  test_sample_row_count: 0

# Disable for a specific test
models:
  - name: customer_data
    data_tests:
      - elementary.volume_anomalies:
          config:
            meta:
              disable_test_samples: true
[Test Result Samples] In short, it's not strictly required, but it significantly speeds up investigation of failures — especially for non-anomaly tests with a small number of columns. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.
c
Can you specify which you want to exclude? @kapa.ai Now i see these: Warning: Freshness exceeded the acceptable times on source "fnx-analytics-ing-pgsql-prod.dlt_f3_live_433770_fortnox_insurance.invoice" Powered by Elementary Source: dlt_f3_live_433770_fortnox_insurance.invoice | Env: prod | Status: warn | Time: 2026-03-18 040153 UTC | Suppression interval: 24 ā„¹ļø Details Tags No tags Owners No owners Subscribers No subscribers Description Source freshness validates if the time elapsed between the test execution to the latest record is above an acceptable SLA threshold. Path
models/0_raw/pgsql_src.yml
I wanna exclude Tags, Subscribers, we don't use that.
k
Yes, you can exclude specific fields using
alert_fields
. Simply list only the fields you want to keep, and omit the ones you don't (like
tags
and
subscribers
). Based on your example alert, you'd want to keep `table`/source info,
owners
,
description
,
result_message
, and
path
— so configure it like this in your `dbt_project.yml`:
Copy code
models:
  my_project:
    +meta:
      alert_fields: ["table", "column", "owners", "description", "result_message", "test_results_sample"]
Or if you want to apply it under the
tests
key:
Copy code
tests:
  my_project:
    +meta:
      alert_fields: ["table", "column", "owners", "description", "result_message", "test_results_sample"]
By specifying
alert_fields
, only the listed fields will appear in the alert — anything omitted (like
tags
and
subscribers
) will not be shown. [OSS Alerts Configuration] > Important: After updating
dbt_project.yml
, you need to run a dbt command (e.g.,
dbt run
or
dbt build
) so Elementary picks up the new configuration via its on-run-end hooks, before running
edr monitor
. [Slack thread] Note that
alert_fields
is currently supported only for test alerts, not for all alert types. [OSS Alerts Configuration] šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.
c
Yeah i have done that. Could it be that source freshness is tied to source config or somethign? @kapa.ai
k
Yes, that's a very relevant point. For source freshness alerts, the configuration needs to be placed on the source in your
sources.yml
file, not just under the
models
key in
dbt_project.yml
. There is also a known dbt-core bug that affects sources specifically: for sources, the meta priority order is reversed — project-level config takes the highest priority, overriding source/table-level config. This means if you have conflicting config at different levels, the project-level one wins. [Slack thread] To configure
alert_fields
for a source freshness alert, add the
meta
block directly on the source table in your `sources.yml`:
Copy code
sources:
  - name: my_source
    tables:
      - name: my_table
        meta:
          alert_fields: ["table", "owners", "description", "result_message"]
Additionally, note that the knowledge sources confirm that
alert_fields
is currently supported only for test alerts — it's not explicitly confirmed to work for source freshness alerts. [OSS Alerts Configuration] So it's possible that
alert_fields
simply doesn't apply to freshness alerts at all, which could explain why your changes aren't having an effect. If that's the case, the knowledge sources don't contain enough information to confirm a workaround for customizing freshness alert fields specifically. You may want to raise this as a question or feature request in the Elementary community Slack or GitHub. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.
c
Can i set it like a default on all sources like this in dbt_project.yml: sources: meta: alert_fields: ["table", "description", "result_message"] @kapa.ai
k
Yes, you can set it globally for all sources in
dbt_project.yml
, but the syntax needs the
+
prefix to apply it to all resources in that path. Based on community findings, the correct format is:
Copy code
sources:
  +meta:
    alert_fields: ["table", "description", "result_message"]
Or if your sources are organized in a directory/subfolder:
Copy code
sources:
  your_directory:
    your_subfolder:
      +meta:
        alert_fields: ["table", "description", "result_message"]
[Slack thread] Important caveats to be aware of: 1. dbt-core bug with sources: For sources, the meta priority order is reversed — project-level config takes the highest priority and overrides source/table-level config. So if you also have
meta
set on individual tables in your
sources.yml
, the
dbt_project.yml
value will win. [Slack thread] 2. Run a dbt command after changes: Elementary only picks up config changes via its on-run-end hooks, so you need to run
dbt run
,
dbt test
, or
dbt build
after updating
dbt_project.yml
before running
edr monitor
. Simply running
dbt source freshness
is not enough. [Slack thread] 3.
alert_fields
is confirmed for test alerts
— as noted in our previous exchange, it's not explicitly confirmed to work for source freshness alerts specifically, so results may vary. šŸ‘ 0 button šŸ‘Ž 0 button ā„¹ļø Tip: Mention @elementary.ai in the thread for follow-ups or DM the app for 1-to-1 help.