Expose a first-class telemetry API so operators can observe the server in production.
Scope
- Metrics — counters, gauges, histograms for: accepted connections, active connections per protocol, request rate, request duration, response status classes, bytes in/out, TLS handshake duration, HTTP/2 stream concurrency, HTTP/3 packet rates, CoDel pause events, queue depth.
- Prometheus-compatible text exposition endpoint (opt-in).
- Tracing — OpenTelemetry-compatible spans for accept → parse → dispatch → respond, with context propagation from
traceparent header.
- Structured logs — JSON-formatted access log with configurable fields.
- PHP-side hooks:
$server->onMetric(), $server->onSpan() so user code can emit custom telemetry on the same pipeline.
- Zero-cost when telemetry is disabled (compile-time and runtime).
Acceptance
- Prometheus scrapes the endpoint successfully and renders the standard server dashboard.
- OTel collector receives spans with correct parent/child relationships.
- No measurable throughput regression with telemetry off; <5% with metrics on.
Expose a first-class telemetry API so operators can observe the server in production.
Scope
traceparentheader.$server->onMetric(),$server->onSpan()so user code can emit custom telemetry on the same pipeline.Acceptance