Implement diagnostics sampling. This causes a percentage of randomly sampled clients to send all diagnostics. This random sampling is done entirely on the client and does not require Remote Config.
Sampling is controlled via a ClientConfig property called diagnosticsSamplingPercentage. A value of 0 disables diagnostic sampling for all clients. For example, setting this value to 5 will cause a random 5% across all users to be cohorted into sending diagnostics.
End date
If you enable diagnostics sampling, you must also provide an explicit end date via diagnosticsSamplingEndDateString. When this date elapses, sampling is disabled across all users. Always use an absolute date for this value.
This feature is designed for short-term diagnostics usage only. Do not leave it running in production without an end date in mind.
Remote Config interoperability
Designed for use on platforms where Remote Config is not available. If Remote Config is enabled, this sampling configuration is ignored. Random sampling is designed to replicate rudimentary experiment cohorting entirely client-side.
Likewise, setting diagnostic sampling flags (either this flag or diagnosticsSamplingEndDateString) via Remote Config does nothing.
Cohorting
Attempts to create a consistent cohort for the set of users with sampling enabled. To this end, sampling is done using the following:
A hash of the persisted logUserID. This should persist while the same account is logged in. This also applies to signed-out users until they log in.
If 1 is not available, uses UIDevice.current.identifierForVendor. This should persist for (at least) the duration of app install.
If 2 is not available, generates a new random UUID for the session. This persists only for the current session.
See ClientConfigService for sampling implementation.
Diagnostic features
If sampling is enabled, the current logging session proceeds as though the following flags are enabled:
diagnosticsIncludeBatchSummaries
diagnosticsIncludeAncestorIDHistory
eventsIncludeIDProvenances
eventsIncludeClientPositions
If you set any of those flags individually to true and then enable diagnostics sampling, the flags you set will always be enabled, and the other diagnostics flags will be enabled according to random sampling.
Implement diagnostics sampling. This causes a percentage of randomly sampled clients to send all diagnostics. This random sampling is done entirely on the client and does not require Remote Config.
Sampling is controlled via a
ClientConfig
property calleddiagnosticsSamplingPercentage
. A value of 0 disables diagnostic sampling for all clients. For example, setting this value to5
will cause a random 5% across all users to be cohorted into sending diagnostics.End date
If you enable diagnostics sampling, you must also provide an explicit end date via
diagnosticsSamplingEndDateString
. When this date elapses, sampling is disabled across all users. Always use an absolute date for this value.This feature is designed for short-term diagnostics usage only. Do not leave it running in production without an end date in mind.
Remote Config interoperability
Designed for use on platforms where Remote Config is not available. If Remote Config is enabled, this sampling configuration is ignored. Random sampling is designed to replicate rudimentary experiment cohorting entirely client-side.
Likewise, setting diagnostic sampling flags (either this flag or
diagnosticsSamplingEndDateString
) via Remote Config does nothing.Cohorting
Attempts to create a consistent cohort for the set of users with sampling enabled. To this end, sampling is done using the following:
logUserID
. This should persist while the same account is logged in. This also applies to signed-out users until they log in.UIDevice.current.identifierForVendor
. This should persist for (at least) the duration of app install.See
ClientConfigService
for sampling implementation.Diagnostic features
If sampling is enabled, the current logging session proceeds as though the following flags are enabled:
diagnosticsIncludeBatchSummaries
diagnosticsIncludeAncestorIDHistory
eventsIncludeIDProvenances
eventsIncludeClientPositions
If you set any of those flags individually to
true
and then enable diagnostics sampling, the flags you set will always be enabled, and the other diagnostics flags will be enabled according to random sampling.