Skip to main content

Dead simple pipeline monitoring. Know when your pipelines die.

Project description

Deadpipe Python SDK

Dead simple pipeline monitoring. Know when your pipelines die.

Installation

pip install deadpipe

Quick Start

Option 1: Decorator (Recommended)

from deadpipe import Deadpipe

dp = Deadpipe("your-api-key")

@dp.heartbeat("daily-sales-etl")
def run_pipeline():
    # Your pipeline code here
    process_data()
    return {"records_processed": 1500}  # Optional: track records

# That's it! Deadpipe will ping on success or failure.
run_pipeline()

Option 2: Context Manager

from deadpipe import Deadpipe

dp = Deadpipe("your-api-key")

with dp.pipeline("hourly-sync"):
    # Your code here
    sync_data()

Option 3: Manual Ping

from deadpipe import Deadpipe

dp = Deadpipe("your-api-key")

try:
    run_my_job()
    dp.ping("my-job", status="success", records_processed=1000)
except Exception as e:
    dp.ping("my-job", status="failed")
    raise

Option 4: Environment Variable

Set DEADPIPE_API_KEY and use module-level functions:

import deadpipe

@deadpipe.heartbeat("my-pipeline")
def my_job():
    pass

Airflow Integration

from deadpipe import Deadpipe

dp = Deadpipe(api_key=Variable.get("DEADPIPE_API_KEY"))

@dp.heartbeat("{{ dag.dag_id }}")
def my_task():
    ...

Or add to the end of any task:

from deadpipe import ping

def my_task():
    # ... your code ...
    ping("daily-etl", status="success")

dbt Integration

Add to your dbt_project.yml on-run-end hook:

on-run-end:
  - "{{ deadpipe_heartbeat('dbt-run') }}"

Or call from Python:

# In your dbt runner script
from deadpipe import Deadpipe

dp = Deadpipe("your-api-key")

with dp.pipeline("dbt-daily"):
    subprocess.run(["dbt", "run"], check=True)

API Reference

Deadpipe(api_key, base_url, timeout)

Create a client instance.

  • api_key: Your API key (or set DEADPIPE_API_KEY env var)
  • base_url: Override for self-hosted (default: https://www.deadpipe.com/api/v1)
  • timeout: Request timeout in seconds (default: 10)

dp.ping(pipeline_id, status, duration_ms, records_processed, app_name)

Send a heartbeat.

  • pipeline_id: Unique identifier for this pipeline
  • status: "success" or "failed"
  • duration_ms: How long the run took (optional)
  • records_processed: Number of records (optional)
  • app_name: Group pipelines under an app (optional)

@dp.heartbeat(pipeline_id, app_name, on_error)

Decorator that auto-sends heartbeats.

  • on_error: What to do on exception:
    • "ping" (default): Send failed heartbeat, then re-raise
    • "raise": Re-raise without heartbeat
    • "ignore": Send success heartbeat anyway

with dp.pipeline(pipeline_id, app_name)

Context manager for heartbeats.

Zero Dependencies

This SDK has no external dependencies. It uses only Python standard library.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deadpipe-0.1.0.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

deadpipe-0.1.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file deadpipe-0.1.0.tar.gz.

File metadata

  • Download URL: deadpipe-0.1.0.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deadpipe-0.1.0.tar.gz
Algorithm Hash digest
SHA256 895c918eb0bc9c1856118a050b1c3ba7732533104a09cfa5485d429e050e3df6
MD5 b0ef470043d5adaae4c204261fba469b
BLAKE2b-256 eaf2b031e5b120fc23ac264a72f565a8d366794f041b22e940eb754a373ad085

See more details on using hashes here.

File details

Details for the file deadpipe-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: deadpipe-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for deadpipe-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fcb7f0feed776e420905994f2bd682c44ad43d292ff29b4c7606bb33f417426c
MD5 8fb2decca1cd89dcc70600949a6661f5
BLAKE2b-256 f173b96658a9a159728a5a2dd1806db5a9eefb117966fe3876e70e817a4b4892

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page