SentinelFlow is an asynchronous, config-driven observability engine that evaluates business metrics, detects threshold breaches, and dispatches structured alerts β with built-in resilience, tracing, and Prometheus telemetry.
Built for SRE teams, platform engineers, and backend developers who need reliable metric monitoring without vendor lock-in.
Modern infrastructure generates metrics across dozens of services. Teams face two recurring problems:
- Alert fatigue β noisy, undeduplicated notifications from naive threshold checks.
- Fragile monitoring β one failing check stalls the entire pipeline.
SentinelFlow addresses both by providing:
- Isolated, bounded-concurrency execution β one slow or failing check never blocks others.
- Cooldown-based alert aggregation β duplicate alerts are suppressed within configurable windows.
- Circuit breakers per check β cascading failures are automatically contained.
- Full pipeline observability β every ingestion, evaluation, and dispatch is traced and metered.
Who benefits: SRE teams reducing MTTR, backend teams adding custom business metric checks, platform engineers building internal monitoring foundations.
| Category | Technology |
|---|---|
| Language | Python 3.11+ |
| Async Runtime | asyncio, aiohttp |
| Config & Validation | Pydantic v2 (strict models), PyYAML |
| Metrics | prometheus-client (Counter, Histogram, Gauge) |
| Tracing | OpenTelemetry SDK + OTLP HTTP exporter |
| Resilience | Circuit breaker, per-check timeouts, bounded semaphores |
| Retry | tenacity with exponential backoff + jitter |
| Persistence | aiosqlite (async SQLite) |
| Testing | pytest, pytest-asyncio (42 deterministic tests) |
| Type Safety | mypy --strict (zero errors, zero type: ignore) |
| Containerization | Docker, Docker Compose |
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β config.yaml + .env β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββ¬ββββββββββββββββ
β β
ββββββββΌβββββββ ββββββββΌβββββββ
β AppConfig β β AppSettings β
β (Pydantic) β β(env secrets)β
ββββββββ¬βββββββ βββββββββββββββ
β
ββββββββΌβββββββ
β Scheduler βββββ run_once / daemon
ββββββββ¬βββββββ
β
ββββββββΌβββββββ ββββββββββββββββ
β Executor ββββββΆβ Resilience β
β (semaphore) β β (CB + timeout)β
ββββ¬ββββ¬ββββ¬βββ ββββββββββββββββ
β β β
βββββββΌβ ββΌβββββ βββΌββββββββ
βIngestβ βEval β βHandler β
β(HTTP)β β(Thr/ β β(Slack) β
β β βFresh)β β β
ββββββββ ββββββββ βββββββββββ
β β β
βββββββΌββββββββΌββββββββββΌββββββ
β Observability Layer β
β Prometheus β OTLP Tracing β
βββββββββββββββββββββββββββββββ
| Component | Responsibility |
|---|---|
| Ingestor | Fetches metric payloads from external sources (HTTP REST APIs) |
| Evaluator | Analyzes payloads against configurable rules (threshold, freshness) |
| AlertPolicy | Deduplicates and rate-limits alerts using cooldown windows |
| Executor | Orchestrates check execution with bounded concurrency |
| Resilience | Per-check circuit breakers, timeouts, and semaphore isolation |
| Observability | Prometheus counters/histograms + OpenTelemetry distributed traces |
| Capability | Detail |
|---|---|
| π Circuit Breaker | Prevents cascading failures β auto-opens after N failures, resets after timeout |
| β±οΈ Per-Check Timeout | Each check runs in isolated asyncio.wait_for β no blocking the pipeline |
| π Prometheus Metrics | Check counts, durations, in-flight gauges, HTTP request tracking |
| π Distributed Tracing | End-to-end spans for ingest β evaluate β dispatch via OTLP |
| π Alert Deduplication | Cooldown + dedupe windows suppress repeated alerts intelligently |
| π©Ί Health Endpoints | /healthz and /readyz for liveness/readiness probes |
| π Structured Logging | JSON-formatted logs with correlation context for production debugging |
| π Retry with Backoff | Exponential backoff + jitter on transient network failures |
| π§ͺ Strict Type Safety | mypy --strict across entire codebase β zero Any leakage |
SentinelFlow exposes three observability surfaces:
| Endpoint | Port | Purpose |
|---|---|---|
Prometheus /metrics |
9108 |
Scrape target for Grafana/Alertmanager |
Admin /healthz /readyz |
9109 |
Kubernetes-style liveness/readiness probes |
| OTLP traces | 4317 |
Distributed tracing to Jaeger/Tempo/Collector |
Metrics exported:
sentinelflow_checks_totalβ total checks executed (by check_id, status)sentinelflow_check_duration_secondsβ histogram of check latenciessentinelflow_inflight_requestsβ gauge of currently running checkssentinelflow_http_requests_totalβ outbound HTTP request counts
# 1. Clone
git clone <repository_url>
cd SentinelFlow_Business_Observability_Engine
# 2. Create virtualenv
python3 -m venv .venv
source .venv/bin/activate # Mac/Linux
# .venv\Scripts\activate # Windows
# 3. Install
pip install . # Runtime only
pip install ".[dev]" # With pytest + mypy
# 4. Configure
cp .env.example .env
# Edit .env β set SLACK_WEBHOOK_URL if using Slack handler
# 5. Run
python -m src.maincd infra
docker compose up --buildpytest tests/ -v # 42 deterministic testsmypy --strict src observability runtime resilienceSentinelFlow uses two configuration sources:
global:
concurrency_limit: 10 # Max parallel checks
scheduler_mode: "run_once" # or "daemon"
interval_seconds: 60 # Daemon polling interval
default_timeout_seconds: 15.0
checks:
- metric_id: "api_health"
ingestor:
type: "http_api"
url: "https://api.example.com/status"
method: "GET"
evaluators:
- type: "threshold"
operator: "<"
value: 1
handlers:
- type: "slack_webhook"
webhook_url_env_key: "SLACK_WEBHOOK_URL"
resilience:
timeout_seconds: 10.0
circuit_breaker:
enabled: true
failure_threshold: 5| Variable | Purpose |
|---|---|
SLACK_WEBHOOK_URL |
Slack Incoming Webhook endpoint (must be HTTPS) |
OTLP_ENDPOINT |
OpenTelemetry collector address |
METRICS_PORT |
Prometheus metrics server port (default: 9108) |
ADMIN_PORT |
Admin health/ready server port (default: 9109) |
DATABASE_URL |
SQLite connection string |
Even as an independent engine, SentinelFlow demonstrates production patterns that directly translate to organizational value:
- Proactive failure detection β catches metric degradation before users report incidents
- Reduced alert fatigue β deduplication and cooldown windows cut noise by suppressing repeat notifications
- Cascading failure prevention β circuit breakers isolate unhealthy checks automatically
- Full pipeline visibility β Prometheus metrics + OTLP traces enable data-driven SRE decisions
- Lightweight deployment β single binary, no infrastructure dependencies beyond Python
Suitable as a foundation for internal monitoring platforms, on-call alerting, and SLA compliance tracking.
| Dimension | Status |
|---|---|
| Type Safety | mypy --strict β zero errors, zero type: ignore |
| Test Suite | 42 deterministic tests (unit + integration) |
| Dependency Health | pip check clean, no broken requirements |
| Docker | Production Dockerfile + Compose stack |
| CI Ready | make test && make type-check single-command validation |
| Architecture | Clean Architecture with strict layer boundaries |