picoclaw/docs/design/ETL_TODO.md
google-labs-jules[bot] 6de54991ab feat: implement ETL visibility tracking for API Gateway, logging, and tracing
- Add OpenTelemetry metrics middleware to HTTP server for RPS and latency
- Implement HTTP request tracing with UUID trace IDs and context propagation
- Introduce standardized ErrorCategory logic in logger package
- Update docs/design/ETL_TODO.md with completed tasks

Co-authored-by: hobbyistlabs-coder <267281733+hobbyistlabs-coder@users.noreply.github.com>
2026-03-19 22:10:27 +00:00

2.1 KiB

ETL Visibility TODO List

This document tracks the tasks required to implement the "Ultimate Visibility" ETL framework.

1. Extract (Ingestion & Telemetry Collection)

  • Structured Logging: Ensure zerolog is used consistently across the codebase for structured JSON logging. Add context to logs where missing (session IDs, tool inputs/outputs).
  • Basic Metrics Implementation: Introduce a metrics package (e.g., using expvar or a Prometheus client) to expose basic application metrics.
  • Goroutine Tracking: Implement a metric to track the number of active Goroutines.
  • Memory Tracking: Implement a metric to track heap allocation and GC pauses.
  • AgentLoop Telemetry: Add specific instrumentation to the AgentLoop (iteration duration, tool execution duration, failure counts).
  • LLM Provider Telemetry: Track API call latency, token usage, and failover reasons for LLM providers.
  • API Gateway Telemetry: Track request rates (RPS), latency percentiles, and error rates for HTTP and WebSocket endpoints.
  • Tracing Instrumentation: Introduce trace IDs at entry points (HTTP, WebSocket) and propagate them via context to track end-to-end execution flow.

2. Transform (Stream Processing & Enrichment)

  • Log Normalization: Standardize error classifications (e.g., Model Failure, Infrastructure Failure, Logic Failure) to ensure consistent log querying.
  • Aggregation Strategy: Design the pipeline for aggregating high-volume events before they reach the data warehouse (e.g., Vector.dev configuration).

3. Load (Storage & Analytics)

  • Time-Series Database: Set up or integrate with a time-series database (e.g., Prometheus) for metrics storage.
  • Log Warehouse: Set up or integrate with an OLAP database (e.g., ClickHouse, Elasticsearch) for log and trace storage.
  • Dashboards: Create initial Grafana dashboards visualizing the Four Golden Signals (Latency, Traffic, Errors, Saturation).
  • Alerting: Configure alerts based on metric thresholds (e.g., GC pauses > 20ms, Goroutine counts continuously rising).