Add video playback observability to Sentry#11111
Conversation
|
Claude finished @vineyardbovines's task in 6m 16s —— View job Review: Add video playback observability to Sentry
Solid, well-scoped PR. The 1.
|
|
There was a problem hiding this comment.
Pull request overview
This PR adds Sentry performance tracing around video playback so the app can capture “scroll + autoplay” performance baselines (including JS stall and slow/frozen frame measurements) ahead of the new-architecture upgrade.
Changes:
- Enables Sentry
tracesSampleRate(1.0 internal / 1% prod) and adds anew_archtag on the global scope for filtering. - Introduces
createPlaybackTelemetryto manage a rootvideo.playbackspan per “activation window”, recording readiness/play timing and outcomes. - Wires playback telemetry into the immersive video feed (expo-video players) and in-feed native video embeds (BlueskyVideoView callbacks), including error reporting and unit tests.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/screens/VideoFeed/index.tsx | Adds a usePlaybackTelemetry hook to open/close playback spans for the active immersive-feed player, including a preloaded signal. |
| src/logger/sentry/setup/index.ts | Enables performance tracing sampling and sets a new_arch tag on the global Sentry scope for easier filtering. |
| src/lib/media/video/playbackTelemetry.ts | New telemetry helper that manages the playback span lifecycle and attaches timing/outcome attributes. |
| src/lib/media/video/tests/playbackTelemetry.test.ts | Adds unit tests for span lifecycle behavior (activation, idempotent end, error outcome, re-activation). |
| src/components/Post/Embed/VideoEmbed/VideoEmbedInner/VideoEmbedInnerNative.tsx | Adds an optional onError callback so callers can record telemetry before throwing to the error boundary. |
| src/components/Post/Embed/VideoEmbed/index.tsx | Hooks telemetry into in-feed video embed state transitions (active/loading/status) and forwards native errors. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (active) { | ||
| telemetryRef.current ??= createPlaybackTelemetry({ | ||
| surface: 'feed', | ||
| presentation: embed.presentation === 'gif' ? 'gif' : 'video', | ||
| }) | ||
| telemetryRef.current.activated() | ||
| } else { | ||
| telemetryRef.current?.deactivated() | ||
| } |
There was a problem hiding this comment.
So if it becomes active again, will we re-open the span or start a new one, or can it only report telemetry once in it's lifecycle? Thinking about a user like scrolling back up to a previous video.
| if (span) return | ||
| activatedAt = Date.now() | ||
| sawReady = false | ||
| sawPlaying = false | ||
| span = Sentry.startInactiveSpan({ |
There was a problem hiding this comment.
Ok looks like it will create a new one, nice
Adds Sentry performance spans around video playback in feeds, to establish old-arch baselines for scroll + autoplay performance ahead of the new architecture upgrade.
What
tracesSampleRate(1.0 internal, 1% prod). This is what makes spans send at all, and it auto-enables the SDK's JS stall tracking and slow/frozen frame tracking, whose measurements attach to every root span. Also adds anew_archtag for filtering.createPlaybackTelemetry(src/lib/media/video/playbackTelemetry.ts): opens onevideo.playbackroot span per activation window (video becomes the active autoplaying one, ends on deactivation) withsurface,presentation,timeToReadyMs,timeToFirstPlayMs,outcome, and error info. Since these are root spans, stall and frame measurements ride along, capturing scroll smoothness while a video is on screen. Sentry-only; nothing goes to the analytics pipeline.BlueskyVideoViewevent callbacks inVideoEmbed/index.tsx(plus an optionalonErrorprop onVideoEmbedInnerNative)usePlaybackTelemetryhook on the expo-video players, with apreloadedattribute to separate load time from swipe latencyWeb is untouched. Side effect: the existing
video.uploadspans, which were created but never sampled, now flow at the same rates.Test plan
pnpm typecheck,pnpm lint,pnpm test,pnpm prettierpass.