-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
1
-
Not Needed
Scope
Report telemetry data by sampling sessions. This means at the start of any mongosh session we will determine, at random, if we want to report telemetry for that session. The number of sessions we report telemetry for per day will be limited below a certain threshold to hit the ~11B events / year mark.
We are going to use a decorator named SampledMongoshAnalytics that will decide wether the current session should be sent to analytics or not.
It will be configurable by:
- An environment variable called MONGOSH_ANALYTICS_SAMPLE, that will passthrough any sampling when set to a truthy value. It won't passthrough any user preferences on telemetry. Users that disabled explicitly the telemetry won't send telemetry events.
- Via it's constructor, with the probability of enabling analytics for this specific session
We will print a log wether an analytics session is going to be sampled or not, to keep track of any possible issues on analytics.
We decided as per a discussion with amanda.santos@mongodb.com and anna.henningsen@mongodb.com that we will sample 1% of sessions.