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

Capture network requests and responses in session replay #16410

Closed
1 task
pauldambra opened this issue Jul 6, 2023 · 18 comments
Closed
1 task

Capture network requests and responses in session replay #16410

pauldambra opened this issue Jul 6, 2023 · 18 comments
Labels
enhancement New feature or request

Comments

@pauldambra
Copy link
Member

pauldambra commented Jul 6, 2023

The Monitoring team is currently considering improving PostHog by adding the ability to capture network requests and responses to session recordings / replay.

We already capture network calls that are made and their performance data using the browsers' built-in PerformanceObserver. Adding capture of requests, responses, and status codes would allow our users to more thoroughly understand the behavior of their applications.

Alongside this we would add the ability to sanitize/censor that data so that we reduce the inherent risk of capturing sensitive data.

🗂 Considered Goals

  • Add network request and response capture to the web SDK

These goals are being considered by the Monitoring Team and we'd love to hear user feedback, as well as ideas for stretch goals or implementation. Please add to this issue!

If you like this idea, please leave a 👍 or ❤️ reaction on this post to vote for it -- your votes and feedback help us prioritize what to work on next!

@pauldambra pauldambra added the enhancement New feature or request label Jul 6, 2023
@annikaschmid annikaschmid changed the title Capture network requests and responses in session recording Capture network requests and responses in session replay Jul 6, 2023
@henninghorn
Copy link

This sounds like a great feature!

In our use case, we could use the collected network request to inspect if our frontend is structuring requests as expected for the backend, and see if our backend responses are as expected.

@pauldambra
Copy link
Member Author

We're now looking to recruit one or two users to test this feature with us.

We've been running it in production on posthog.com safely

@MaelAbgrall
Copy link

MaelAbgrall commented Dec 13, 2023

Don't know if this is planned, but Sentry has a fantastic way to censor content through a callback before it is sent (https://docs.sentry.io/platforms/javascript/configuration/filtering/)

This lets me easily inspect the objects being sent to sentry and catch/censor any private data.

@pauldambra
Copy link
Member Author

Hey @MaelAbgrall,

We already have that mechanism for replay data in general and have added that for request headers/payload too 👍

Would you like to test it with us?

@MaelAbgrall
Copy link

MaelAbgrall commented Dec 13, 2023

cool!
Why not, but I'm just getting started with posthog, and won't puch to prod until Feb 24, so most of what I will test will be in a dev/staging environment

@pauldambra
Copy link
Member Author

Turned the flag on for you, so you should see them as options in replay config. You can drop feedback direct to the team using https://app.posthog.com/home#panel=support%3Afeedback%3Asession_replay

@MaelAbgrall
Copy link

Great thanks, have you got documentation for the callback?

Typescript tells me maskNetworkRequestFn is deprecated, I found maskCapturedNetworkRequestFn in the autocomplete but nothing on your docs

@jape-dev
Copy link

This would be super useful feature - would love to test it!

@mohit-gyaan
Copy link

Waiting for this useful feature, would love to test it!

@pauldambra
Copy link
Member Author

@mohit-gyaan I've been able to (I think) find your account from your github profile and enabled the flag for you. so you should see them as options in replay config. You can drop feedback direct to the team using https://us.posthog.com/home#panel=support%3Afeedback%3Asession_replay

@jape-dev it wasn't clear what account you're using. Can you share here? Or email paul AT posthog DOT com

@jape-dev
Copy link

jape-dev commented Jan 2, 2024

@pauldambra james AT useairpipe DOT com

@pauldambra
Copy link
Member Author

Awesome, flag is on for you too @jape-dev. Thanks!

@pauldambra
Copy link
Member Author

this has now been added to our feature preview so anyone can opt in to testing it

@mohit-gyaan
Copy link

this has now been added to our feature preview so anyone can opt in to testing it

@pauldambra do i have to upgrade the js sdk to latest version for this to work properly ?

@pauldambra
Copy link
Member Author

It's on version > 1.88.x

What version are you running?

@mohit-gyaan
Copy link

It's on version > 1.88.x

What version are you running?

We are using 1.93.3, but not able to see payload in network requests.

@pauldambra
Copy link
Member Author

@mohit-gyaan I've checked the account I thought was yours - do you have recordings disabled?

Can you log in to the project you're testing this with and let me know using https://us.posthog.com/home#panel=support%3Asupport%3Asession_replay which links the project to the support ticket so I can take a look.

@pauldambra
Copy link
Member Author

this is now generally available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants