Automattic / Automattic-Tracks-iOS

Client library for tracking user events for later analysis
GNU General Public License v2.0
43 stars 12 forks source link

Exposing sampleRate parameter #271

Closed jleandroperez closed 9 months ago

jleandroperez commented 10 months ago

Details:

In this PR we're enhancing CrashLoggingDataProvider: our goal is for the host app to specify the sampleRate in which events are uploaded.

We're gonna be using the Events subsystem to track down sync errors (starting at a 1% sample rate).

Thanks in advance!!


jleandroperez commented 10 months ago

Gentleman, sorry to bug you all!! Adding an extra parameter, so that we can control the rate at which Events are reported.

Context: We'd like to use this to shed some light into DayOne's sync errors. https://github.com/bloom/DayOne-Apple/issues/22360

Thank you all in advance!!

jleandroperez commented 10 months ago

Hola @mokagio!!! hope you're doing super!!

All feedback addressed. Replicating same note as in https://github.com/bloom/DayOne-Apple/issues/22360, for visibility.

All I could find in the events filter (web settings) interface are filters related to User Agent, Releases or specific IP(s).

Unless I'm missing something huuuuge, perhaps it's not possible to replicate the same thing this setting does? (Events Sampling Rate).

Thanks in advance!!

mokagio commented 10 months ago

perhaps it's not possible to replicate the same thing this setting does? (Events Sampling Rate).

I noticed there's a way to filter events based on the error message:

image

But it looks like an on-off switch, which might be good as a killswitch in case of a spike, but not good to have a fraction of the events reported for monitoring.

jleandroperez commented 9 months ago

@mokagio I swear I started by writing tests, but I immediately noticed that there is no direct way to query those values, and yeah I'm afraid we're a bit tight on time, and extracting the SentryOptions initializer is a bit out of scope atm.

Thanks a lot for your feedback!!!