Add realtime observability logging - #29
Draft
VerioN1 wants to merge 13 commits into
Draft
Conversation
- send WebRTC stats, diagnostics, and SDK logs to api/v1/telemetry - filtered LiveKit warning/error forwarding via DecartLiveKitLogger - replace ack polling loops with AsyncRequest continuations - DecartUserAgent for User-Agent header parity with JS SDK - configurable connection/media options on RealtimeConfiguration Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…lures Permanent connect failures and exhausted reconnects previously left logs and diagnostics buffered indefinitely since the periodic flush only runs after sessionStarted. Add flushPendingIfNeeded that synthesizes a pre-session id and forces a drain, called on permanent failure, on reconnect exhaustion, and before stopTelemetry in disconnect. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Emit iceCandidatePairsState whenever the pair-state distribution changes, capturing frozen/waiting/in-progress/failed counts even when no pair has been nominated. Surfaces ICE checking progression for sessions that never reach a selected pair. Add NetworkPathObserver wrapping NWPathMonitor; emits networkPathChange diagnostic on Wi-Fi/cellular/expensive/constrained transitions for the lifetime of the manager. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The api-platform telemetry route validates diagnostics[] with a strict discriminatedUnion on `name`. iOS was emitting names not in the union (iceCandidatePair, iceCandidatePairsState, networkPathChange, generationStarted) and an invalid client-session-connection-breakdown shape, so zod rejected the whole payload and the route silently returned 204 — logs[] never reached Datadog. - drop the unsupported diagnostic emissions for now - filter emitLog/recordLog and the LiveKit forwarder to .error only - convert path-unsatisfied transitions to an error-level log entry - remove the redundant remote-track stats poll (local share peer conn) - drop the "LiveKit reconnect completed" info-level log Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Match the JavaScript SDK's realtime observability contract so client-side connection diagnostics land in Datadog under the same names and shapes: - Replace per-phase phaseTiming with a consolidated client-session-connection-breakdown diagnostic using the JS phase names (websocket-open, room-join, initial-state-handshake, webrtc-handshake, publish-local-track), and add the reconnect diagnostic. - Forward selected-candidate-pair (winning ICE pair) derived from the WebRTC stats collector, recovering ICE visibility despite Swift LiveKit not exposing the underlying peer connections. - Rename network/room instrumentation events to the JS contract (network-state/-change, browser-online/-offline, room-connected/ -disconnected/-reconnecting/-reconnected); drop non-parity events. - Keep logs local-only and keep periodic stats off the WS, matching JS. - Decouple network-path monitoring from the observability forwarder; start and stop it explicitly around a session. Tests: 37 passing (swift test). Co-authored-by: Cursor <cursoragent@cursor.com>
- Configure LiveKit for a video-only session so the microphone is never engaged and audio is never routed to the speaker: force a playback-only AVAudioSession category and disable the audio engine before connecting. This also fixes the crash on devices without NSMicrophoneUsageDescription. - Stop publishing local audio and stop subscribing to remote audio. - Example: mirror both the AI-processed remote view and the local PiP based on the active camera (front mirrored, back un-mirrored) and update live on camera switch. Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds realtime observability forwarding so selected client diagnostics and WebRTC stats are sent through the signaling websocket while preserving the existing HTTP telemetry behavior where appropriate.
Changes
Validation
swift test