Simple monitoring and incident management for startups
Just 3 lines of code to get started
Uses SQLite database, no external dependencies
Web UI for monitoring incidents and metrics
Command-line interface for incident management
Automatic incident detection and correlation
Minimal performance impact on your application
import overcast
# Initialize the SDK
overcast.init(
api_key="your-api-key-here",
customer_name="Your Startup"
)
# Log events
overcast.log("User login successful", level="INFO", service="auth")
# Record metrics
overcast.metric("response_time", 0.23, tags={"endpoint": "/api/users"})
# Send alerts
overcast.alert("Database connection failed", severity="high", service="db")
# Shutdown when done
overcast.shutdown()
import overcast
with overcast.OvercastContext(api_key="your-key", customer_name="Your Startup"):
overcast.log("Application started", service="web-app")
overcast.metric("startup_time", 1.2, service="web-app")
# Your business logic here
do_business_logic()
# Overcast automatically shuts down when exiting context
Start the dashboard to monitor your incidents in real-time:
python -m sdk.server --api-key your-key --customer-name "Your Startup"
Visit http://localhost:5000
to see:
Use the CLI for incident management:
# Start interactive CLI
python -m sdk.server --api-key your-key --cli-only
# Available commands:
overcast list # Show recent incidents
overcast triage # Auto-triage incidents
overcast logs [service] # Show recent logs
overcast metrics [service] # Show recent metrics
overcast status # System status
Initialize the Overcast SDK.
Log a message with context.
Record a metric value.
Send an alert for immediate attention.
Shutdown the SDK and clean up resources.
from flask import Flask
import overcast
app = Flask(__name__)
# Initialize Overcast
overcast.init(api_key="your-key", customer_name="Your Web App")
@app.route('/api/users')
def get_users():
start_time = time.time()
try:
overcast.log("Fetching users", level="INFO", service="web-api")
# Your business logic
users = fetch_users_from_db()
# Record response time
response_time = time.time() - start_time
overcast.metric("response_time", response_time,
tags={"endpoint": "/api/users"})
return jsonify(users)
except Exception as e:
overcast.log(f"Failed to fetch users: {e}", level="ERROR", service="web-api")
overcast.alert(f"API error: {e}", severity="high", service="web-api")
return jsonify({"error": "Internal server error"}), 500
# Shutdown on app teardown
@app.teardown_appcontext
def shutdown_overcast(error):
overcast.shutdown()
import overcast
def process_user_data(user_id):
with overcast.OvercastContext(api_key="your-key", customer_name="Background Jobs"):
try:
overcast.log(f"Processing user {user_id}", service="background-worker")
# Process data
result = expensive_data_processing(user_id)
# Record success
overcast.metric("job_success", 1, tags={"user_id": user_id})
overcast.log(f"User {user_id} processed successfully", service="background-worker")
return result
except Exception as e:
overcast.log(f"Failed to process user {user_id}: {e}",
level="ERROR", service="background-worker")
overcast.alert(f"Background job failed: {e}",
severity="medium", service="background-worker")
raise
You can use environment variables instead of hardcoding configuration:
export OVERCAST_API_KEY="your-api-key"
export OVERCAST_CUSTOMER_NAME="Your Startup"
export OVERCAST_DB_PATH="./data/overcast.db"
export OVERCAST_DASHBOARD_PORT="5000"
from sdk.core.config import OvercastConfig
# Load from environment
config = OvercastConfig.from_env()
Organize your logging by service/component:
overcast.log("User authenticated", service="auth")
overcast.log("Order processed", service="orders")
overcast.log("Payment completed", service="payments")
overcast.log("Something happened") # service="default"
Use descriptive metric names and relevant tags:
overcast.metric("http_request_duration", 0.25,
tags={"method": "POST", "endpoint": "/api/orders", "status": "200"})
overcast.metric("duration", 0.25)
overcast.init()
is called before logginghttp://localhost:5000
instead of 0.0.0.0
batch_size
configuration (default: 100)polling_interval
to reduce CPU usage if neededEnable debug logging to troubleshoot issues:
from sdk.core.config import OvercastConfig
config = OvercastConfig(
api_key="your-key",
customer_name="Your Startup",
log_level="DEBUG" # Enable debug logging
)
example_usage.py
for a complete working example!