Context

harrow is a thin HTTP framework built directly on Hyper 1.0. The goal is explicit, macro-free routing with built-in observability: tracing spans, Prometheus metrics, and structured request IDs from the start, not bolted on after the fact.

Design

Every route is plain Rust. No proc macros, no magic. The route table is a concrete data structure, inspectable at runtime. This makes it straightforward to enumerate endpoints for health checks, generate OpenAPI-like documentation, or debug routing issues in production.

The framework is split into focused crates:

  • harrow-core: Routing, request/response types, middleware chain
  • harrow-o11y: Tracing integration, Prometheus metrics export, request ID propagation
  • harrow-server: Hyper binding, connection handling, graceful shutdown, optional TLS via rustls
  • harrow-bench: Micro-benchmarks, TCP-level latency tests, and Axum comparison suite

Performance

Target: less than 1 microsecond of added latency over raw Hyper. Current benchmarks on a c7g.xlarge (Graviton3):

Benchmark Latency
Path matching (1 param) 79.6 ns
Route table lookup (100 routes) 1.19 us
TCP round-trip (echo) 24.4 us
Full stack (3 middleware + JSON + params) 31.5 us
Axum equivalent 24.8 us

Continuous flamegraph profiling catches performance regressions before they ship.

Observability

Every request gets a tracing span with structured fields: method, path, status, duration. RED metrics (rate, errors, duration) are emitted automatically. Prometheus scrape endpoint is built in. For AWS deployments, CloudFront request IDs are extracted and propagated as deterministic trace IDs via BLAKE3.