Skip to main content

dbt-heartbeat

A CLI tool to monitor individual dbt Cloud run jobs and receive Slack or OS notifications when they complete.

Why This Exists

Developers working with large dbt projects and merge queues often wait for long-running CI jobs. This tool solves two problems:

  1. Manual Monitoring: Instead of repeatedly checking job status or working on other things and forgetting about your dbt job and holding up the merge queue, automatically get notified when your specific run job completes.
  2. Notification Control: AFAIK, dbt Cloud does not have notifications for job-specific runs. You can get notifications for all jobs of a specific environment/deployment, but not for specific runs within those environment/deployment jobs (i.e your own CI jobs in a staging environment).

Prerequisites

  • Python >= 3.8
  • uv (Python package manager)
  • dbt Cloud account with API access (via the dbt developer PAT)
  • Environment variables:
    • DBT_CLOUD_ACCOUNT_ID
    • DBT_CLOUD_API_KEY
    • SLACK_WEBHOOK_URL

NOTE: While uv is the recommended method for installing dbt-heartbeat, you can also install it using pip install. However, when installing with pip, you are responsible for managing your Python virtual environment and ensuring that the directory containing the executable is included in your system's PATH. In contrast, when using uv no additional environment configuration is required, and the executable is automatically made available in your PATH for immediate use.

Installation

  1. brew install uv
  2. uv tool install dbt-heartbeat
  3. Add environment variables to your .zshrc shell configuration file:
    # Paste in your .zshrc file (Mac: /Users/<user_name>/.zshrc)
    export DBT_CLOUD_ACCOUNT_ID=<dbt_cloud_account_id> 
    export DBT_CLOUD_API_KEY=<dbt_cloud_pat> 
    export SLACK_WEBHOOK_URL=<webhook_url>
    
  4. Run dh <run_job_id> --slack

Version Upgrade:

# Check for latest version
dh --version

# Upgrade to the latest version
uv tool upgrade dbt-heartbeat

Usage

For help:

dh --help

Arguments

  • job_run_id: The ID of the dbt Cloud job run to monitor
    • --slack or -s: Send notifications to Slack (requires SLACK_WEBHOOK_URL environment variable)
  • --poll-interval: Time in seconds between polls (default: 30)
  • --log-level: Set the logging level (default: INFO)
    • Choices: DEBUG, INFO, WARNING, ERROR, CRITICAL
  • --version: Checks for the latest version and prints the current version

Example

# Poll run job with default settings and send notification to system OS
dh 123456

# Poll run job with default settings and send notification to Slack
dh 123456 --slack

# Poll run job with debug logging and 15-second interval and send notification to Slack 
dh 123456 --s --log-level DEBUG --poll-interval 15

Note: You can find the <job_run_id> in the dbt Cloud UI:

  • In the job run details page, look for Run #<job_run_id> in the header of each run
  • Or from the URL when viewing a job run: https://cloud.getdbt.com/deploy/<account_id>/projects/<project_id>/runs/<job_run_id>

Terminal Output

Screenshot 2025-05-15 at 7 47 02 AM

Slack App Notification

Screenshot 2025-06-16 at 10 52 12 AM Note that in the example above, I created a Slack App in my company's workspace and authorized the incoming webhook URL to post messages directly to the Slack App's Direct Messages

Metadata

Release files for dbt-heartbeat 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dbt-heartbeat 0.2.4
File Size Uploaded Provenance Actions
dbt_heartbeat-0.2.4.tar.gz 16.2 kB Without provenance Details for dbt_heartbeat-0.2.4.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dbt-heartbeat 0.2.4
File Interpreter ABI Platform Actions
dbt_heartbeat-0.2.4-py3-none-any.whl Python 3 none any Details for dbt_heartbeat-0.2.4-py3-none-any.whl

Total release size: 32.3 kB

Release files / dbt_heartbeat-0.2.4.tar.gz

Download URL dbt_heartbeat-0.2.4.tar.gz
Size 16.2 kB
Tags Source
SHA-256 checksum
How to use checksums
308078d8e2c76c1fd96ce62c375bdc1f5ea5a57e699ebdf3d3fea2107c7a5fcd
BLAKE2b-256 checksum
How to use checksums
69eee00b79eba388b412f0001654593cd6dc9eee07dd2d495d0c0d3fa8e19762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.6

Release files / dbt_heartbeat-0.2.4-py3-none-any.whl

Download URL dbt_heartbeat-0.2.4-py3-none-any.whl
Size 16.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6a5ed505afe425c6698101692830356573a4c8029a8556b72c007fd388ab6f04
BLAKE2b-256 checksum
How to use checksums
cf1d4f92814419eb41546bb87c34cb10b50c075078141545e52ccab5bb278146
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.7.6

Security for dbt-heartbeat 0.2.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page