getsentry / sentry-cocoa

The official Sentry SDK for iOS, tvOS, macOS, watchOS.
https://sentry.io/for/cocoa/
MIT License
812 stars 325 forks source link

Sampling off session replays based off device.class for iOS/Android SDKs #4387

Open sentryadam0000345 opened 1 month ago

sentryadam0000345 commented 1 month ago

Problem Statement

Currently this is not supported based off the docs listed here.

Solution Brainstorm

Having something similiar to the transactions sampler that we have here would be ideal:

https://docs.sentry.io/platforms/javascript/configuration/sampling/#setting-a-sampling-function

Product Area

Replays

getsantry[bot] commented 1 month ago

Auto-routing to @getsentry/product-owners-replays for triage ⏲️

jas-kas commented 1 month ago

Hey @sentryadam0000345 👋

Thanks for your feature request. This work is not currently scoped as part of our general availability release but we'll log this in our backlog.

Is there a particular use-case where you'd find this useful?

sentryadam0000345 commented 1 month ago

With potentially higher performance impacts with the new mobile session replays feature, I might want to make sure that none of my lower class devices have mobile session replay turned on or are collected (so perhaps this is more about session replay being selectively initialized for a certain class of devices).

bruno-garcia commented 1 month ago

Is the goal to not record a replay of the overhead can be noticeable to the user? If so, we might have something built in that turns off replay if we detect the overhead is high. But a custom sampling strategy based on device class has some limitations. The main being the fact we don't know the class in the device. That's populated server side in Sentry.

sentryadam0000345 commented 1 month ago

Yes that's the goal and turning off replay if overhead is high sounds like it can work. Thanks