Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Distributed recording #20026

Open
marandaneto opened this issue Jan 30, 2024 · 2 comments
Open

Distributed recording #20026

marandaneto opened this issue Jan 30, 2024 · 2 comments
Labels
enhancement New feature or request feature/replay Features for Team Replay

Comments

@marandaneto
Copy link
Member

marandaneto commented Jan 30, 2024

Is your feature request related to a problem?

I'd like to see the events captured on the backend when watching a session recording from my front end.

https://posthoghelp.zendesk.com/agent/tickets/9883

Describe the solution you'd like

Everything works automagically.

The PostHog JS SDK patches the HTTP clients such as fetch and sets a header with the current $session_id and $window_id (also the timestamp optionally) if the session recording is running.

Let's call this header POSTHOG_RECORDING -> sessionId_123, windowId_456.

If the backend is using a PostHog SDK, the SDK hooks up on requests via interceptors and reads the POSTHOG_RECORDING header.

The $session_id and $window_id are then set to all captured events automatically for that request.

$session_id: sessionId_123
$window_id: windowId_456

Describe alternatives you've considered

You can do this manually.

When using the PostHog JS SDK, you can call posthog.get_session_replay_url and read the current URL

You can also read the $session_id calling posthog.get_session_id but you cannot read the $window_id currently, so the get_session_replay_url is the only alternative for now.

Set this URL as a header for all HTTP calls, let's call the header POSTHOG_RECORDING_URL.

If the backend is using a PostHog SDK, the SDK hooks up on requests via interceptors and reads the POSTHOG_RECORDING_URL header.

Set the Recording URL to all captured events for that request.

This URL can also be set to an error monitoring tool such as Sentry

Additional context

Instead of defining PostHog headers, we could use standard headers for this type of context such as
trace-context
baggage

Somehow relates to #8183

https://posthog.com/docs/session-replay/troubleshooting#filtering-cant-find-my-custom-events

Thank you for your feature request – we love each and every one!

@rahi-ashutosh
Copy link

+1

@pauldambra
Copy link
Member

see #15026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature/replay Features for Team Replay
Development

No branches or pull requests

3 participants