Reta Gasser
07/21/2025, 6:07 PM07/21/2025 11:57:13 AM
Traceback (most recent call last):
07/21/2025 11:57:13 AM
File "/usr/local/bin/edr", line 8, in <module>
07/21/2025 11:57:13 AM
sys.exit(cli())
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1442, in __call__
07/21/2025 11:57:13 AM
return self.main(*args, **kwargs)
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1363, in main
07/21/2025 11:57:13 AM
rv = self.invoke(ctx)
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/elementary/cli/cli.py", line 66, in invoke
07/21/2025 11:57:13 AM
return super().invoke(ctx)
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1830, in invoke
07/21/2025 11:57:13 AM
return _process_result(sub_ctx.command.invoke(sub_ctx))
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1830, in invoke
07/21/2025 11:57:13 AM
return _process_result(sub_ctx.command.invoke(sub_ctx))
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 1226, in invoke
07/21/2025 11:57:13 AM
return ctx.invoke(self.callback, **ctx.params)
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/core.py", line 794, in invoke
07/21/2025 11:57:13 AM
return callback(*args, **kwargs)
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/click/decorators.py", line 34, in new_func
07/21/2025 11:57:13 AM
return f(get_current_context(), *args, **kwargs)
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/elementary/monitor/cli.py", line 710, in send_report
07/21/2025 11:57:13 AM
config.validate_send_report()
07/21/2025 11:57:13 AM
File "/usr/local/lib/python3.10/site-packages/elementary/config/config.py", line 283, in validate_send_report
07/21/2025 11:57:13 AM
raise InvalidArgumentsError(
07/21/2025 11:57:13 AM
elementary.exceptions.exceptions.InvalidArgumentsError: You must provide a platform to upload the report to (Slack token / S3 / GCS).
here is the code I am running:
set -e
# Pipe Civis credentials into JSON file in the container
mkdir -p $(pwd)/service_accounts
printf "%s" "$GOOGLE_APPLICATION_CREDENTIALS_PASSWORD" > $(pwd)/service_accounts/elementary.json
# Set default app creds
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/service_accounts/elementary.json
# Generate and send report to Slack
edr monitor -p /app/src/slack_report -t prod --env "$PROJECT_ENVIRONMENT" --days-back $DAYS_BACK --slack-token $SLACK_TOKEN_PASSWORD --slack-channel-name $SLACK_CHANNEL --test TRUE --group-by alert --report-url $CLOUD_RUN_URL --filters tags:sae-syncouts send-report
Can you help?kapa.ai
07/21/2025, 6:07 PMkapa.ai
07/21/2025, 6:07 PMelementary.exceptions.exceptions.InvalidArgumentsError: You must provide a platform to upload the report to (Slack token / S3 / GCS). indicates that Elementary cannot find the required configuration to determine where to upload or send the report. This usually means that the CLI is not detecting your Slack token, S3, or GCS configuration. Key things to check based on your code and the knowledge sources: 1. Command Structure: You are running: edr monitor -p /app/src/slack_report -t prod --env "$PROJECT_ENVIRONMENT" --days-back $DAYS_BACK --slack-token $SLACK_TOKEN_PASSWORD --slack-channel-name $SLACK_CHANNEL --test TRUE --group-by alert --report-url $CLOUD_RUN_URL --filters tags:sae-syncouts send-report The edr monitor and send-report are two separate commands. You should not chain them together in a single command. - Use either edr monitor ... for sending alerts, or - edr send-report ... for sending the report. 2. Required Arguments: For sending a report to Slack, you need to provide both --slack-token and --slack-channel-name (or use a config file with these values). If you are using environment variables, make sure they are set and accessible in the environment where the command runs. - The variable should be named EDR_SEND_REPORT_SLACK_TOKEN if you want Elementary to pick it up automatically without specifying --slack-token in the command line. - If you specify --slack-token $SLACK_TOKEN_PASSWORD, ensure that $SLACK_TOKEN_PASSWORD is not empty and is exported correctly. 3. Config File Path: If you are using a config file, make sure you provide the directory path (not the file path) to --config-dir. For example: edr send-report --config-dir /path/to/.edr/ not edr send-report --config-dir /path/to/.edr/config.yml [See this discussion for details.](https://slack.com/archives/C02CTC89LAX/p1700569729527469) 4. Environment Variables: If you want to use environment variables for the Slack token, set EDR_SEND_REPORT_SLACK_TOKEN for edr send-report or EDR_MONITOR_SLACK_TOKEN for edr monitor commands. [Reference](https://slack.com/archives/C02CTC89LAX/p1700737966995449) 5. Separation of Commands: If you want to send both alerts and reports, you need to run the commands separately: - For alerts: edr monitor --slack-token $SLACK_TOKEN_PASSWORD --slack-channel-name $SLACK_CHANNEL ... - For reports: edr send-report --slack-token $SLACK_TOKEN_PASSWORD --slack-channel-name $SLACK_CHANNEL ... [Reference](https://slack.com/archives/C02CTC89LAX/p1683218922315159) Summary of what to fix: - Do not chain monitor and send-report in one command. - Make sure your Slack token and channel are provided and not empty. - If using a config file, provide the directory, not the file. - If using environment variables, ensure they are set and named correctly. Example working command: edr send-report --slack-token $SLACK_TOKEN_PASSWORD --slack-channel-name $SLACK_CHANNEL or, if using a config file: edr send-report --config-dir /path/to/.edr/ with the config file containing: yaml slack: token: <your_slack_token> channel_name: <your_channel> If you still get the error, double-check that the token and channel are not empty and that the environment variables are available in the execution context. If you need to use both Slack and GCS/S3, make sure both are configured in your config file or provided as CLI arguments, and do not comment out any required fields. If you only want to use Slack, you can omit the S3/GCS parameters. Let me know if you need more specific troubleshooting!Reta Gasser
07/21/2025, 6:16 PMset -e
# Pipe Civis credentials into JSON file in the container
mkdir -p $(pwd)/service_accounts
printf "%s" "$GOOGLE_APPLICATION_CREDENTIALS_PASSWORD" > $(pwd)/service_accounts/elementary.json
# Set default app creds
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/service_accounts/elementary.json
# Generate and send report to Slack
edr monitor -p /app/src/slack_report -t prod --env "$PROJECT_ENVIRONMENT" --days-back $DAYS_BACK --slack-token $SLACK_TOKEN_PASSWORD --slack-channel-name $SLACK_CHANNEL --test TRUE --group-by alert --report-url $CLOUD_RUN_URL --filters tags:sae-syncouts
The logs don't say anything about filtering the report to my specific tag. Was the report actually filtered?
07/21/2025 12:09:28 PM
You are using Elementary 0.19.0, however version 0.19.3 is available.
07/21/2025 12:09:28 PM
Consider upgrading by running: "/usr/local/bin/python3.10 -m pip install --upgrade elementary-data"
07/21/2025 12:09:28 PM
07/21/2025 12:09:28 PM
Any feedback and suggestions are welcomed! join our community here - <https://bit.ly/slack-elementary>
07/21/2025 12:09:28 PM
07/21/2025 12:09:28 PM
2025-07-21 18:09:28 — INFO — Running with edr=0.19.0
07/21/2025 12:09:28 PM
2025-07-21 18:09:28 — INFO — Installing packages for edr internal dbt package...
07/21/2025 12:09:28 PM
2025-07-21 18:09:28 — INFO — Running dbt command --log-format json deps --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src/slack_report --target prod
07/21/2025 12:09:39 PM
[33;20m2025-07-21 18:09:39 — WARNING — You are using incompatible versions between edr (0.19.0) and Elementary's dbt package (0.16.2).
07/21/2025 12:09:39 PM
To fix please update your packages.yml, and run:
07/21/2025 12:09:39 PM
dbt deps && dbt run --select elementary
07/21/2025 12:09:39 PM
[0m
07/21/2025 12:09:39 PM
2025-07-21 18:09:39 — INFO — Elementary's database and schema: '"tmc-data-warehouse.dbt_elementary"'
07/21/2025 12:09:39 PM
2025-07-21 18:09:39 — INFO — Running internal dbt run to populate alerts
07/21/2025 12:09:39 PM
2025-07-21 18:09:39 — INFO — Running dbt command run -m elementary_cli.alerts.alerts_v2 --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src/slack_report --target prod --vars {"days_back": 3}
07/21/2025 12:10:10 PM
2025-07-21 18:10:10 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_pending_alerts", "macro_args": {"days_back": 3, "type": null}} --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src/slack_report --target prod
07/21/2025 12:10:18 PM
2025-07-21 18:10:18 — INFO — Running dbt command --log-format json run-operation elementary.log_macro_results --args {"macro_name": "elementary_cli.get_last_alert_sent_times", "macro_args": {"days_back": 3, "type": null}} --project-dir /usr/local/lib/python3.10/site-packages/elementary/monitor/dbt_project --profiles-dir /app/src/slack_report --target prod
07/21/2025 12:10:21 PM
2025-07-21 18:10:21 — INFO — Update skipped alerts
07/21/2025 12:10:23 PM
Finished
07/21/2025 12:10:24 PM
Run used approximately 728.32 millicores of its 2500 millicore CPU request
07/21/2025 12:10:24 PM
Run used approximately 167.88 MB of its 7500 MB memory limitkapa.ai
07/21/2025, 6:16 PMkapa.ai
07/21/2025, 6:16 PM--filters tags:sae-syncouts flag with the edr monitor command, Elementary should filter alerts and only send those that match the specified tag. However, the logs you provided do not explicitly mention which filters were applied or which tags were used during execution. This is expected: the Elementary CLI logs typically do not print out the filter criteria being used—they focus on the execution steps and any warnings or errors. What you can expect: - If the command completes without error and you do not receive alerts for tests outside the sae-syncouts tag, the filtering is working as intended. - The absence of explicit log lines about filtering does not mean the filter was ignored; it's just not verbose about filter application in the logs. Supporting information: - The official documentation and community answers confirm that using --filters tags:<tag> will filter alerts to only those with the specified tag, but do not mention that this will be echoed in the logs. The filtering is handled internally and is not always reflected in the CLI output unless there is an error or no alerts match the filter criteria [Alerts CLI flags](https://docs.elementary-data.com/oss/guides/alerts/alerts-configuration#alerts-cli-flags). Summary: Your report/alerts should be filtered by the tag you specified, even though the logs do not explicitly state this. If you want to confirm, you can check which alerts were sent to Slack or review the Elementary tables (such as alerts or alerts_source_freshness) to see which alerts are marked as sent. If you need more verbose output about filtering, this is not currently documented as a feature in the CLI logs. If you have further doubts, you can test with a tag that matches no tests and confirm that no alerts are sent, which would demonstrate that the filter is being applied. Let me know if you need help with a specific verification step!Reta Gasser
07/21/2025, 7:27 PMkapa.ai
07/21/2025, 7:27 PMkapa.ai
07/21/2025, 7:27 PMmeta instead of directly under config or the test itself, Elementary will not recognize them for filtering. This is a frequent source of issues. Make sure your tags are defined like this: yaml tests: - not_null: config: severity: warn tags: [your_tag] and not under `meta`: yaml tests: - not_null: meta: tags: [your_tag] # This will not work! [See this discussion for details.](https://slack.com/archives/C02CTC89LAX/p1692776333435499) 2. dbt Artifacts Refresh: If you recently added or changed tags, you must re-run dbt test (or dbt run -s dbt_tests) to update the dbt artifacts that Elementary reads. If you do not do this, Elementary will not see the new tags and will not filter alerts as expected. [Reference](https://slack.com/archives/C02CTC89LAX/p1692787232072399) 3. Elementary Version Issues: There have been bugs in past versions of Elementary where tag-based filtering did not work as expected. Make sure you are using a recent version of both the Elementary dbt package and the edr CLI. Upgrading to the latest version has resolved similar issues for other users in the past [Reference](https://slack.com/archives/C02CTC89LAX/p1685699058896329). 4. Check for Disabled Alerts: Ensure that you do not have any of the disable_warn_alerts or related variables set to true in your dbt_project.yml, as this would prevent warning alerts from being generated or sent [Reference](https://slack.com/archives/C02CTC89LAX/p1697784304685269). 5. Materialization Issues: If you have a global model configuration like +materialized: table, it can cause Elementary's internal models (like alerts_dbt_tests) to not refresh properly, resulting in missing alerts. Removing such a configuration and recreating the Elementary schema has resolved this for other users [Reference](https://slack.com/archives/C02CTC89LAX/p1697784304685269). Summary: - Double-check your tag placement in the YAML. - Re-run dbt test after any tag changes. - Ensure you are on the latest version of Elementary. - Check for any disabling variables in your config. - Avoid global materialization overrides that affect Elementary models. If you have verified all of the above and still do not see alerts, please check the alerts and alerts_dbt_tests tables in your Elementary schema to see if the alerts are being generated at all. If they are not present there, the issue is upstream of the alerting process. Let me know if you need help with a specific step or want to share a snippet of your YAML for review!Reta Gasser
07/21/2025, 7:30 PM{{
config(
materialized="table",
partition_by={
"field": "utc_date_attempted",
"data_type": "timestamp"
},
tags=["contactability_attempts"]
)
}}kapa.ai
07/21/2025, 7:30 PMkapa.ai
07/21/2025, 7:30 PM--filters tags:<tag> flag (or --select tag:<tag>) with edr monitor, Elementary will filter alerts based on tags that are present on both the model and the test. However, Elementary’s alert filtering and reporting UI currently only supports filtering by model-level tags, not test-level tags. This means: - If you apply the tag only at the model level (as in your example), the filter will work for model-level tags. - If you want to filter or group by test-level tags, this is not currently supported in the Elementary UI or alert filtering—only model tags are recognized for filtering and grouping in the current version. From the documentation and community answers: - “The current filters only work on model tags. But filtering also by test tags would be a nice to have feature.” [Slack answer](https://slack.com/archives/C02CTC89LAX/p1698073229870299) - “We only support model level tags at the moment, not test tags.” [Slack answer](https://slack.com/archives/C02CTC89LAX/p1678370484105529) - “dbt supports adding tags to tests, but Elementary currently ignores these tags and only uses models tags. We want to change that :)” [Github Issue](https://github.com/elementary-data/elementary/issues/369) Summary: If you want your alerts to be filtered by the tag, you must apply the tag at the model level (as in your example). Tags on individual tests are not currently used for alert filtering or grouping in Elementary. If you need filtering by test-level tags, this is a known feature request but is not yet supported.