Overview
Elementary’son-run-end hooks collect test results and dbt artifacts, which are essential for monitoring but can slow down local development. Here’s the recommended approach:
- Local development: Disable hooks to speed up your workflow
- Dev/Staging environments: Enable monitoring to catch issues early
- Production: Always enabled for full observability
Disable Hooks in Local Development
When developing locally, theon-run-end hooks that upload run results and dbt artifacts can slow down your dbt runs. It’s recommended to disable these hooks in your local environment.
You can disable specific hooks using variables in your dbt_project.yml:
dbt_project.yml
- Hooks are disabled for local development (when
target.nameis notprod,staging, ordev) - Hooks are enabled for your dev, staging, and production environments
Monitor Dev and Staging Environments
While you should disable hooks in local development, you should enable monitoring for any dev or staging environments where you run tests. This allows you to:- Catch data quality issues before they reach production
- Validate test coverage and test results in non-production environments
- Get early visibility into data problems
- Configure your dbt targets - Make sure your dev and staging targets are named consistently (e.g.,
dev,staging) - Update the disablement vars - Include your dev/staging target names in the condition, as shown in the example above
- Set up Elementary Cloud environments - Create separate environments in Elementary Cloud for each of your dbt targets (dev, staging, prod)
Production Configuration
In production, Elementary should always be enabled to provide full observability. The configuration above ensures hooks are enabled for production by includingprod in the list of monitored environments.
Complete Example Configuration
Here’s a complete example that covers all scenarios:dbt_project.yml
Alternative: Disable Entire Package
If you prefer to disable the entire Elementary package in local development (note: this will also disable Elementary tests), you can use:dbt_project.yml
Next Steps
After configuring your environments:- Set up Elementary Cloud environments - Create environments in Elementary Cloud for each of your monitored targets (dev, staging, prod)
- Configure sync scheduling - Set up webhook-triggered syncs for real-time updates. See the Sync Scheduling guide for details
- Configure alerts - Set up alerts for your dev and production environments to get notified of data quality issues