Files
tiny-forge/plans/observability-proxy-mgmt/PLAN.md
T
alexei.dolgolyov c38b7d4c78 feat(observability): phase 1 - schema, models & event log backend
Add database foundation for observability features:
- event_log table with severity/source filtering and pagination
- standalone_proxies table for user-created reverse proxies
- stale_threshold_days setting (default 7 days)
- Auto-persist warn/error events from event bus to database
- SSE broadcast of persistent events for real-time UI updates
- Frontend types and API functions for downstream UI phases
2026-03-30 10:59:13 +03:00

3.6 KiB

Feature: Observability & Proxy Management

Branch: feature/observability-proxy-mgmt Base branch: main Created: 2026-03-30 Status: 🟡 In Progress Strategy: Incremental Mode: Automated Execution: Orchestrator

Summary

Extend Docker Watcher with four interconnected features: stale container detection, standalone proxy management with health monitoring, a unified proxy viewer, and a persistent event log — plus container stats and notification triggers.

Build & Test Commands

  • Build (frontend): cd web && npm install && npm run build
  • Build (backend): go build -o docker-watcher ./cmd/server
  • Build (full): make build
  • Test (backend): go test ./...
  • Lint (backend): go vet ./...
  • Lint (frontend): cd web && npm run check

Tech Stack Summary

  • Backend: Go 1.24, chi v5 router, SQLite (modernc.org/sqlite), Docker SDK (moby/moby/client)
  • Frontend: SvelteKit 2.15, Svelte 5, TypeScript 5.7, Tailwind CSS 4, Vite 6
  • Real-time: Server-Sent Events with auto-reconnect
  • Auth: JWT + optional OIDC
  • Encryption: AES-256-GCM for credentials

Project Conventions

  • Go: gofmt, small interfaces, error wrapping with fmt.Errorf("context: %w", err), constructor injection
  • DB: Single-row settings, additive migrations via ALTER TABLE (errors ignored for idempotency), CREATE TABLE IF NOT EXISTS for new tables
  • API: Envelope pattern {success, data?, error?}, chi route groups, admin middleware for writes
  • Frontend: Svelte 5 runes ($state, $derived, $effect), TypeScript interfaces mirroring Go models, centralized api.ts, custom components (no UI library)
  • Files: Feature-organized, small focused files
  • State: Immutable patterns, no mutation

Phases

  • Phase 1: Schema, Models & Event Log Backend [domain: backend] → subplan
  • Phase 2: Stale Container Detection [domain: backend] → subplan
  • Phase 3: Direct Proxy Creation with Validation [domain: backend] → subplan
  • Phase 4: Unified Proxy Viewer UI [domain: frontend] → subplan
  • Phase 5: Stale Containers UI [domain: frontend] → subplan
  • Phase 6: Direct Proxy Creation UI [domain: frontend] → subplan
  • Phase 7: Event Log UI [domain: frontend] → subplan
  • Phase 8: Container Stats & Notifications [domain: fullstack] → subplan

Parallelizable phases:

  • Phases 4, 5, 6, 7 are all frontend phases that touch different routes/components and can potentially run in parallel after all backend phases (1-3) complete.

Phase Progress Log

Phase Domain Status Review Build Committed
Phase 1: Schema & Event Log backend Not Started
Phase 2: Stale Detection backend Not Started
Phase 3: Proxy Creation backend Not Started
Phase 4: Proxy Viewer UI frontend Not Started
Phase 5: Stale Containers UI frontend Not Started
Phase 6: Proxy Creation UI frontend Not Started
Phase 7: Event Log UI frontend Not Started
Phase 8: Stats & Notifications fullstack Not Started

Final Review

  • Comprehensive code review
  • Full build passes
  • Full test suite passes
  • Merged to main