Hi I have setup alert in slack as mentioned here, ...
# community-support
k
Hi I have setup alert in slack as mentioned here, but unfortunately i am not getting alert when i trigger with token via CLI
n
Hey @Kelvin Brangissko! Thanks for reaching out 🙂 Can you share what’s the command you’re running? Also also if you could share your
edr.log
from the run where you expected to get alerted? Are you sure there are errors you should be alerted about? About your second question - there is an open feature request about it - https://github.com/elementary-data/elementary/issues/1228 Some contributions on the way, but for now the answer is yes - you can only be notified using slack
k
I ran dbt test, dbt run and then edr monitor --slack-token <your_slack_token> --slack-channel-name <slack_channel_to_post_at> --group-by [table | alert]
i did with slack token and slack channel
but no alerts ntg
configured my app as per the document as well
I have some schema changes fail in my report
but ALERTS_SCHEMA_CHANGES table is empty
n
Thanks for the information @Kelvin Brangissko! Three notes/questions: • Do you have
--group-by [table | alert]
in your command? If so - try removing it. So the command should be
edr monitor --slack-token <your_slack_token> --slack-channel-name <slack_channel_to_post_at>
• Can you change the order to be:
dbt run -s elementary
,
dbt test
and then
edr monitor --slack-token <your_slack_token> --slack-channel-name <slack_channel_to_post_at>
? • If all these doesn’t work I would really like to get the
edr.log
, you can grab it from from where you’re running you command ->
edr_target/edr.log
k
I have a long edr.log
any particular things u prefer? maybe i can share
n
Can you see any errors in the log? You can also share it with me in a DM Also did you try the 2 first suggestions?
k
what does this dbt run -s elementary does?
n
It created the tables and views elementary needs to run You can follow the instructions here https://docs.elementary-data.com/oss/quickstart/quickstart-cli-package which might give you a good start to running elementary Looking at your logs seems like
elementary_test_results
table isn’t found, it might be a permissions issue but I’m guessing if you follow the steps in the quickstart I sent you you’ll see the table The table is first created in the
dbt run -s elementary
and then being populated during the test runs
k
elementary_test_results -- it is in the schema
2024-02-14 193210 — INFO — Querying source freshness alerts last sent times. 2024-02-14 193210 — INFO — Running dbt --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_last_source_freshness_alert_sent_times", "macro_args": {"days_back": 1}} --project-dir /Users/brangisk/Projects/cgs/pulse-instrument-poc/.venv/lib/python3.9/site-packages/elementary/monitor/dbt_project 2024-02-14 193219 — INFO — Update skipped alerts at "alerts" 2024-02-14 193219 — INFO — Update skipped alerts at "alerts_models" 2024-02-14 193219 — INFO — Update skipped alerts at "alerts_source_freshness"
n
• These “Update skipped alerts at “alerts” are probably because no alerts are written to the table. Do you see new alerts in the table (new records in
alerts_dbt_models
and
alerts_models
) • Can you share which schema you see the
elementary_test_results
in? • Also looking at the logs you can see there’s another error for this: (Pasting the error here for documentation as well) -
Copy code
Unable to parse dbt log message: Initiating login request with your identity provider. A browser window should have opened for you to complete the login. If you can't see it, check existing browser windows, or your OS settings. Press CTRL+C to abort and try again...
Traceback (most recent call last):
  File "/Users/brangisk/Projects/cgs/pulse-instrument-poc/.venv/lib/python3.9/site-packages/elementary/clients/dbt/dbt_log.py", line 35, in parse_dbt_output
    yield DbtLog.from_log_line(log_line)
  File "/Users/brangisk/Projects/cgs/pulse-instrument-poc/.venv/lib/python3.9/site-packages/elementary/clients/dbt/dbt_log.py", line 18, in from_log_line
    log = json.loads(log_line)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Do you have any authentication using a browser in the process?
k
I have only dbt snowflake authentication
Do you see new alerts in the table (new records in
alerts_dbt_models
and
alerts_models
) -- this tables are empty
Any idea how i can trigger any anomalies. Everything seems find and unable to trigger any failures
elementary_test_results in raw_dv schema
n
Can you share your profiles file? (Redacted 🙂 )
Just to explain further - the reason I’m asking is because based on your logs the CLI is looking for this table in another schema, I think maybe something in your elemetary profile isn’t configured correctly
k
Yes, the elementary are stored in different schema
We would like to store the elementary tables on separate schema and the models are in different schema
n
The elementary tables are by default created in
<schema_name>_elementary
so if for example you’re working on snowflake and you snowflake profile schema is
schema_name
the elementary profile should be
schema_name_elementary
Try changing it in your profile and run again
For documentation and transparency - the
_elementary
suffix was missing from the schema name in the elementary profile, right now there’s a permissions issue for the user (no permissions to create the schema) which is being handled by @Kelvin Brangissko