$ show Owloops/updo
Updo is a production-grade CLI tool for multi-target website uptime and performance monitoring. It continuously checks HTTP endpoints from the command line or a TOML configuration file, displaying real-time results in an interactive TUI or simple text output. The core monitoring engine performs configurable HTTP requests (GET/POST/PUT, custom headers, assertion text, redirect handling, SSL verification) and captures detailed timing breakdowns (DNS, TCP, TTFB, download). It can also deploy and invoke AWS Lambda functions across 13 global regions for geographically distributed probing, aggregating results from multiple vantage points. The tool integrates with Prometheus via Remote Write for long-term metric storage and visualization, and supports desktop alerts via beeep plus webhook notifications to Slack, Discord, or custom endpoints with auto-detected formatting. Architecture is a monolith Go application built on cobra for CLI management, termui for the TUI, and AWS SDK v2 for Lambda operations. Key entry points are the `updo monitor` and `updo aws` subcommands. Data flows from config or CLI flags through a monitoring loop that calls the HTTP checker or Lambda invoker, accumulates stats (t-digest for percentiles, rolling uptime), and pushes structured logs or Prometheus time series.
The LLM identified 4 files worth highlighting for reuse:
Core HTTP checking logic with built-in httptrace timing, body size limiting, redirect handling, SSL verification, and text assertion. The `CheckWebsite` function and `NetworkConfig` struct form a self-contained, configurable HTTP probe that can be extracted into a standalone library for any Go project requiring detailed HTTP timing and health checks.
Strategy pattern for webhook payload formatting. `SelectFormatter()` automatically chooses between Slack, Discord, or generic JSON formatters based on the webhook URL. Each formatter implements the `WebhookFormatter` interface and can be independently tested or extended. This pattern is directly reusable in any Go service that sends webhook notifications with platform-specific formatting.
Converts website check results and SSL expiry data into Prometheus Remote Write protocol buffer TimeSeries. Functions like `ConvertCheckToTimeSeries` and `ConvertSSLExpiryToTimeSeries` are self-contained, well-tested, and produce proper metric names, labels, and sorting. Reusable in any Go project that pushes custom metrics to Prometheus via remote write.
Custom termui widget that renders a horizontal bar chart of HTTP timing stages (Wait, DNS, TCP, TTFB, Download) with color-coded bars and percentage labels. Demonstrates proper extension of termui's `Block` type and can be reused or adapted for any terminal dashboard that needs a time breakdown visualization.