# ============================================================================= # PulseWatch AI - Environment Configuration # Copy this file to .env and fill in the values you want to use. # The application works with EVERY value below left at its default - # AI keys especially are entirely optional; core monitoring, alerts, # incidents, anomaly detection, logs, and the dashboard all work without them. # ============================================================================= # --- AI Providers (all optional - leave blank to disable a provider) ------- OPENAI_API_KEY= ANTHROPIC_API_KEY= GEMINI_API_KEY= OPENAI_MODEL=gpt-4o-mini ANTHROPIC_MODEL=claude-3-5-haiku-20241022 GEMINI_MODEL=gemini-1.5-flash # Automatic mode fallback order (used when a caller doesn't force one provider) PRIMARY_AI_PROVIDER=openai FALLBACK_AI_PROVIDER=anthropic SECONDARY_FALLBACK_AI_PROVIDER=gemini # --- Database ---------------------------------------------------------------- # Leave blank for local SQLite (./pulsewatch.db). Set to a PostgreSQL URL # for production, e.g. postgresql://user:pass@host:5432/dbname DATABASE_URL= # --- Monitoring ---------------------------------------------------------------- DEFAULT_CHECK_INTERVAL_SECONDS=60 MIN_CHECK_INTERVAL_SECONDS=30 DEFAULT_MONITOR_TIMEOUT_SECONDS=10 MAX_CONCURRENT_CHECKS=10 # --- Alerts / Incidents ------------------------------------------------------- FAILURES_BEFORE_INCIDENT=3 LATENCY_WARNING_MS=1000 LATENCY_CRITICAL_MS=3000 # --- Anomaly Detection --------------------------------------------------------- ANOMALY_MIN_SAMPLES=10 ANOMALY_ZSCORE_THRESHOLD=3.0 ANOMALY_PCT_CHANGE_THRESHOLD=100.0 # --- Data Retention ------------------------------------------------------------ METRIC_RETENTION_DAYS=30 # --- Security ------------------------------------------------------------------ # MUST remain false for any public/cloud deployment (Render etc). # Only set true for local testing against your own localhost services. ALLOW_PRIVATE_MONITORING=false MAX_MONITOR_RESPONSE_BYTES=1048576 # Optional: used to derive the local encryption key for stored monitoring # credentials (auth headers). If unset, a local key file is generated. SECRET_KEY= # --- Webhooks (optional) -------------------------------------------------------- WEBHOOK_URL= # --- Server -------------------------------------------------------------------- PORT=8000 # This educational deployment's background scheduler is designed for exactly # ONE worker process. Do not increase this without adding a distributed lock. WEB_CONCURRENCY=1