LogScope AI v2.0
Live dashboard

Technical whitepaper

LogScope AI v2.0

SRE log aggregation, deterministic anomaly detection & AI incident triage — problem, architecture, tooling, dashboard guide, current deployment stack and hardening path. Last updated 2026-09-06. Live system: logscope.freengineer.me.

1. The problem we solve

Modern services emit thousands of log lines per second across multiple files, hosts and formats. Engineers face four pains:

  1. Volume without signal — repetitive lines bury the one new error that matters.
  2. Slow correlation — connecting a spike in service A to a timeout in service B is manual grep work.
  3. Alert fatigue — threshold alerts fire on noise; real incidents hide inside them.
  4. Unsafe AI shortcuts — pasting raw logs into an LLM leaks passwords, tokens, emails and customer IDs.

LogScope treats logs as an application heartbeat: compress repetition into templates, watch the pulse for arrhythmia with deterministic rules, and call the LLM only as a triage copilot over sanitized, bounded evidence.

Engineer facing a wall of logs with one highlighted error
Figure 1 — Repetition compressed into templates; the novel error surfaces automatically. (Illustrative render; mock data.)

2. Design principles

3. Architecture

File tailer+ multiline RedactorPII / secrets Drain3templates Kafka KRaftsanitized only 5-min buckets+ detectors SQLite WAL6-month store Vector indexsimilarity AI workerSev-0..4 sanitization boundary: raw logs never pass this line FastAPI + SSE + dashboard KPIs · triage feed · Ask copilot · whitepaper

Retention

DataKeptWhere
Kafka events (sanitized)24 hoursKRaft topics
Raw & redacted samples24 hours, auto-deletedSQLite
5-minute aggregates, anomalies, AI analyses, embeddings6 monthsSQLite WAL + vector index

4. Tools we use

LayerToolWhy
API + dashboardFastAPI, SSE, Tailwind, Chart.jsReal-time triage UI with zero build step
Template miningDrain3 (per app+env)Online clustering of repetitive lines
StreamingApache Kafka KRaftBuffering, replay, consumer isolation; PRD-mandated boundary
StorageSQLite WAL + numpy vector indexSingle-file ops, concurrent readers, similarity search
AI triageNVIDIA NIM / OpenAI / Gemini (fallback chain) + heuristic offline modeStructured Sev-0..Sev-4 verdicts, prompt-injection guarded
Edge + deployCaddy, Docker Compose, Terraform, GitHub ActionsHTTPS, reproducible stack, IaC, CI/CD
SecretsOCI Vault + instance principalsKeys never live in git, images or CI
Ingestion optionsFluent Bit, Kafka raw topic, CloudWatch LambdaNode agents, direct streams, serverless forwarders

5. Dashboard guide — every box on screen

Navbar: Live Stream + v2.0

Pulsing Live Stream pill reflects SSE connectivity (green = connected). The v2.0 badge marks the release; this whitepaper link sits beside it. The WAL SQLite • Sanitized Kafka note states the storage/streaming posture.

Warning banner

Appears only when something needs attention: backpressure drops, Kafka lag, or AI provider errors with retry state. Hidden when healthy — its absence is itself a signal.

KPI cards

5-Minute Ingestion Volume & Anomaly Timeline

Chart.js chart of bucketed observation volume (cyan) overlaid with error spikes (rose), fed by /api/buckets/timeline. Refresh icon reloads on demand; it answers “did anything just change?” at a glance.

Dashboard render with KPIs, severity cards, timeline and AI chat
Figure 2 — The 5-minute timeline: steady heartbeat, one arrhythmia worth triaging. (Illustrative render; mock data.)

Active Anomalies + filters

Each card carries an INC + 7-digit incident number, severity (Sev-0 critical … Sev-4 info), confidence (very-low…very-high), AI summary, evidence (template IDs, counts, source path/line), possible causes and recommended actions. The auto-refresh dropdown (5s/10s/30s/60s/Off) plus manual Refresh control polling; severity/application/environment/source filters narrow the feed. Empty state (“All Services Operating Normally”) confirms detectors ran and found nothing — distinct from a disconnected stream.

AI incident triage card render
Figure 3 — Triage card: severity, confidence, evidence and actions. (Illustrative render; mock data.)

Dismissed Anomalies Archive

Collapsible history with outcome badges: green Resolved, amber False Alarm, slate Transient. Nothing is deleted — every verdict stays queryable for future AI context.

Ask SRE Copilot

Textarea that morphs into a persistent chat thread on first answer, with follow-up input. Queries embed against historical templates/incidents and answer with evidence references — or explicitly state when evidence is insufficient.

Monitored Sources

Each configured source with application, environment, path and heartbeat status. Read-Only guarantees the collector never writes to log directories.

Incident Action & Resolution modal

Three outcomes: Resolved (fix notes indexed into vector memory for future triage), False Alarm (expected/harmless, kept out of resolution memory), Transient (blip, quick dismiss).

Mined Templates + drill-down modal

Template browser; per-template drill-down shows the pattern, founding sample message, 5-minute bucket rollup history table and bounded sanitized evidence samples — the full audit trail from pulse to verdict.

6. Current deployment stack

LogScope runs today as a single Oracle Always Free Ampere A1 VM (2 OCPU / 12 GB, Terraform-managed, reserved public IP) hosting Kafka, the app, the demo workload generator and Caddy edge proxy for https://logscope.freengineer.me. LLM secrets live in OCI Vault and are refreshed on the VM via instance principal — they never appear in git, images or CI. Two GitHub Actions workflows operate it: infra.yml (infrastructure apply/destroy) and cd.yml (pull, native-ARM rebuild, health-gated at /api/health). Total cost: $0/month inside Always Free limits (200 GB disk, 10 TB egress).

Deployment render: containers, secrets vault and dashboard
Figure 4 — Code to cloud: containers, Vault-held secrets, HTTPS to the browser. (Illustrative render.)
PieceWhat runsNotes
Compute1× VM.Standard.A1.Flex, Ubuntu 24.04 ARMTerraform state in OCI Object Storage; live VM imported, replacement-guarded
NetworkVCN + public subnet, 80/443 open, SSH key-onlyReserved public IP survives restarts — no DNS churn
StackKafka KRaft + LogScope + demo-app + Caddydeploy/oracle/docker-compose.production.yml
SecretsVault: OpenAI / Gemini / NVIDIA keysOCIDs on VM only; values pulled at deploy time
PipelineCI pytest+compose, CD over SSHproduction environment-gated

7. Production hardening (open questions)

Beyond the current stack, these take it production-grade. Defaults proposed; final calls pending review:

TopicDirectionStatus
AuthenticationSSO (GitHub/Google) in front of dashboard; single-user mode endsOpen — provider choice pending
AvailabilitySecond VM / managed Kafka; SQLite → Postgres when write contention bitesOpen — trigger thresholds pending
AlertingSev-0/Sev-1 → Slack + PagerDuty webhooks from AI workerOpen — channels pending
BackupsOCI volume backups + SQLite dumps to Object Storage bucketPlanned
Real log sourcesFluent Bit DaemonSet / Kafka raw topic / CloudWatch forwarder (all built); steady feed choice pendingOpen — source decision pending
Privacy hardeningHMAC (keyed) client pseudonymization replacing POC SHA-256Planned
Cost controlStay in Always Free envelope; egress + retention monitors before any paid stepGuardrail

Open production questions for review: SSO provider? Alert channels? Second-VM trigger? Which steady log source? Answers get recorded in docs/DECISIONS.md.

8. Verification snapshot

34/34 tests passing; ~1,000+ lines/sec sustained with zero drops (benchmark); /api/health 200 in production. Acceptance criteria trace to PRD.md §20.

9. Image generation prompts (theme-locked)

Figures 1–3 above are hand-built inline SVG so they always render. For cover art or slides, use these prompts. Append this style block to every prompt so output matches the LogScope theme:

Style: dark SRE-console aesthetic, deep navy background #070b1a, glowing cyan #22d3ee + electric violet #8b5cf6 accents, rose #fb7185 reserved for errors, emerald #34d399 for healthy states, glassmorphism panels, subtle grid, monospace micro-labels allowed but NO readable sentences, NO logos, NO watermarks.

Tip: generate at 2x, downscale, and overlay real screenshots (dashboard, timeline) for Figures 1–2 if photographic fidelity is preferred over illustration.