<@U088WCP3B4P> in version 0.18.3, where descriptio...
# ask-elementary-ai
m
@kapa.ai in version 0.18.3, where description should be located: under meta or config block?
Copy code
data_tests:
      - elementary.column_anomalies:
          training_period:
            period: day
            count: 7
          detection_period:
            period: day
            count: 1
          timestamp_column: "dt"
          column_name: "total_cost"
          column_anomalies:
            - max
          anomaly_direction: spike
          anomaly_sensitivity: 1
          ignore_small_changes:
            spike_failure_percent_threshold: 30
          fail_on_zero: false
          dimensions: ["cluster_name"]
          tags: ['elementary-test','tmp-test']
          config:
            severity: warn
            description: "Daily cost anomaly test forclusters. To check problematic cluster,see elementary UI"
          meta:
            alert_fields: ["table","column","tags","description","owners","result_message","test_parameters"]
k
A message from kapa.ai
For Elementary version 0.18.3, the correct place to set a test description is under the meta block, not under config. The description should be specified as meta: { description: "..." } within your test definition. This is supported by both the official documentation and multiple Slack discussions, which clarify that Elementary reads the description from the meta dictionary for tests, and not from config. Placing description under config will not have the intended effect in the Elementary dashboard or alerts. Here’s the correct structure:
Copy code
yaml data_tests:   - elementary.column_anomalies:       training_period:         period: day         count: 7       detection_period:         period: day         count: 1       timestamp_column: "dt"       column_name: "total_cost"       column_anomalies:         - max       anomaly_direction: spike       anomaly_sensitivity: 1       ignore_small_changes:         spike_failure_percent_threshold: 30       fail_on_zero: false       dimensions: ["cluster_name"]       tags: ['elementary-test','tmp-test']       config:         severity: warn       meta:         description: "Daily cost anomaly test for clusters. To check problematic cluster, see elementary UI"         alert_fields: ["table","column","tags","description","owners","result_message","test_parameters"]
Key point: - Place description under meta, not config, for it to appear in the Elementary dashboard and alerts [[source]](https://docs.elementary-data.com/oss/guides/alerts/alerts-configuration#alert-properties-in-yml-files) [[source]](https://slack.com/archives/C02CTC89LAX/p1708443408220759) [[source]](https://slack.com/archives/C02CTC89LAX/p1736818351146109). Let me know if you need an example for a different test type!
m
@kapa.ai I currently have it under meta and alert in slack does not contain description
k
A message from kapa.ai
If you have placed the description under the
meta
block and the Slack alert still does not contain the description, there are a few possible reasons based on the knowledge sources: 1. Grouped Alerts Do Not Show Descriptions: If you are using the
slack_group_alerts_by: table
configuration, custom fields like
description
will not appear in grouped alerts. Grouped alerts have a strict format and do not include all custom fields. To see the description, you need to remove the grouping configuration so that alerts are sent per failure instead of per table. This is confirmed in the following exchange: > "You are using the config
slack_group_alerts_by: table
. On grouped alerts Elementary can't use the custom fields, these are only valid for the default alert per failure. The grouped alert has a strict format, as it needs to contain aggregated info about several tests." [Slack discussion](https://slack.com/archives/C02CTC89LAX/p1689573667390299) 2. Correct Placement in `meta`: The description must be under the
meta
block, not under
config
. If it is under
config
, it will not be picked up by Elementary for alerts or the dashboard [[Slack discussion](https://slack.com/archives/C02CTC89LAX/p1708443408220759)]. 3. Run Sequence: After making changes, ensure you run
dbt test
(or
dbt build
) before running
edr monitor
, so that Elementary picks up the latest metadata [[Slack discussion](https://slack.com/archives/C02CTC89LAX/p1696423169407779)]. Summary: - Remove
slack_group_alerts_by: table
if you want the description to appear in Slack alerts. - Make sure the description is under
meta
. - Run
dbt test
before
edr monitor
. If you have already done all of the above and the description still does not appear, there may be a bug or a version-specific limitation not covered in the current knowledge sources.
m
@kapa.ai is this correct?
Copy code
data_tests:
      - elementary.column_anomalies:
          training_period:
            period: day
            count: 7
          detection_period:
            period: day
            count: 1
          timestamp_column: "dt"
          column_name: "total_cost"
          column_anomalies:
            - max
          anomaly_direction: spike
          anomaly_sensitivity: 1
          ignore_small_changes:
            spike_failure_percent_threshold: 30
          fail_on_zero: false
          dimensions: ["cluster_name"]
          tags: ['elementary-test','tmp-test']
          config:
            severity: warn
          meta:
            description: "Daily cost anomaly test for all-purpose clusters. To check problematic cluster, check elementary UI"
            alert_fields: ["table","column","tags","description","owners","result_message","test_parameters"]
k
A message from kapa.ai
Your configuration is correct in terms of placing the
description
under the
meta
block, which is the recommended way for Elementary to pick up and display the description in alerts and the dashboard. This matches the documented and community-supported approach for Elementary version 0.18.3 and similar versions [[Alert properties in
.yml
files](https://docs.elementary-data.com/oss/guides/alerts/alerts-configuration#alert-properties-in-yml-files)]. Example from documentation and Slack:
Copy code
yaml tests:   - elementary.column_anomalies:       ...       meta:         description: "This is my test description"
— This is the correct placement for the description [[Slack example](https://slack.com/archives/C02CTC89LAX/p1736818351146109)]. A few things to double-check: - Make sure you are not using
slack_group_alerts_by: table
in your configuration, as grouped alerts do not show custom fields like
description
in Slack alerts [[Slack grouped alerts explanation](https://slack.com/archives/C02CTC89LAX/p1689573667390299)]. - After updating your YAML, run
dbt test
(or
dbt build
) before running
edr monitor
to ensure the latest metadata is picked up. Summary: Your YAML structure for the test is correct for including a description in Elementary alerts, as long as you are not grouping alerts by table and are following the correct run sequence. If the description still does not appear, it may be due to alert grouping or a version-specific issue not covered in the current knowledge sources.