mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
2c185d1a9e
Spans model per-action operations (open/message/close); they're a poor fit for ad-hoc events with no operation lifecycle. Split logError to dispatch by whether a span is active: - Active span (realtime.open / realtime.message / realtime.close catches) -> attach the error to the existing span; the Sentry span exporter ships it with full operation context (attributes, duration, trace_id). - No active span (pub/sub subscriber, onStart, Swoole error handler, updateWorkerDocument) -> push a utopia/logger Log via the realtimeLogger registry. Goes to Sentry as an event via the Sentry logger adapter (or to logOwl / Raygun / AppSignal). Same dedicated Realtime project either way. Restores the realtimeLogger registry (dropped in the previous "spans only" pass), inlines the now-single-caller $createLogger closure into the logger registry, and drops the recordRealtimeErrorSpan helper — logError is the only function on this path now. Also registers a Pretty span exporter in app/init/realtime/span.php for non-self-hosted editions so Realtime spans are visible in the container's stdout (on self-hosted the existing app/init/span.php already provides it; gating avoids duplicate output).