← Back to Documentation

Script Monitoring

Learn how to monitor your Python scripts and data pipelines with SEER

Getting Started
Monitor any Python script in 3 steps
1

Install seerpy

pip install seerpy
2

Get your API key

Create an API key in Dashboard → API Keys

3

Add monitoring to your script

from seerpy import Seer
import os

# api_key= preferred; apiKey= accepted for backwards compat
seer = Seer(api_key=os.getenv("SEER_API_KEY"), auto_replay=True)

# job_name must match a pipeline in your Seer dashboard
with seer.monitor("my_pipeline", capture_logs=True):
    # Monitoring never raises — Seer outages cannot fail your job
    result = process_data()
What Gets Monitored?
  • Execution status: Success, failure, or running
  • Start and end times: Track how long jobs take
  • Error messages: Capture exceptions and stack traces
  • Logs: Optional stdout/stderr capture
  • Metadata: Custom metrics and context
  • Heartbeats: Monitor long-running processes
Common Use Cases

ETL Pipelines

Track data extraction, transformation, and loading jobs

Scheduled Cron Jobs

Monitor daily, weekly, or monthly automated tasks

Data Validation

Ensure data quality checks run successfully

Airflow/Dagster Tasks

Monitor individual tasks within orchestrated workflows

ML Model Training

Track training jobs and capture performance metrics

Best Practices
  • ✓ Always wrap your script logic in try-catch for error handling
  • ✓ Send meaningful metadata about each run (records processed, file names, etc.)
  • ✓ Use heartbeats for jobs that run longer than 5 minutes
  • ✓ Capture logs on failures for easier debugging
  • ✓ Set up notifications to alert your team immediately
  • ✓ Use descriptive job names that indicate what the script does
Common Mistakes to Avoid
  • ✗ Hardcoding API keys — use environment variables
  • ✗ Using generic job names like "job1" — use descriptive names matching your dashboard
  • ✗ Sending sensitive data in logs or metadata
  • ✗ Creating new Seer instances in loops
  • ✗ Not testing error scenarios