From 578871faf4f1fad1cb758e5167bf5f667e55d98e Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:40:39 -0700 Subject: [PATCH 1/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index 5387a0ec3..a28a9f65b 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -57,6 +57,18 @@ For server SDKs, these reasons for the value you are seeing can be: - `Unrecognized`: the sdk was initialized, but this config did not exist in the set of values - `Uninitialized`: the sdk was not yet successfully initialized +In newer server SDKs, the reasons will be a combination of initialization souce and evaluation reason: +| Initialization Sources | Evaluation Reason | +|------------------------|-------------------| +| Network | LocalOverride | +| Bootstrap | Unrecognized | +| DataAdatper | Unsupported | +| StatsigNetwork | error | +| Uninitialized | | + +- `StatsigNetwork`: fetched from statsig API, most likely due to fallback behavior +- `error`: an error happened during evaluation + In addition to these reasons, the most recent versions of server SDKs will also give you two times to watch: the time at which config definitions initialized the SDK, and the time at which the SDK was currently evaluating those definitions. When you change a gate/config/experiment, the project time will update and server SDKs will download the new definition. If you have not changed your project in two hours, and the evaluation time is saying From 2855fb40c815a9b67f1f4d9d621a5139d3adade9 Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 10:42:49 -0700 Subject: [PATCH 2/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index a28a9f65b..eaa912071 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -57,17 +57,18 @@ For server SDKs, these reasons for the value you are seeing can be: - `Unrecognized`: the sdk was initialized, but this config did not exist in the set of values - `Uninitialized`: the sdk was not yet successfully initialized -In newer server SDKs, the reasons will be a combination of initialization souce and evaluation reason: +In newer server SDKs, the reasons will be a combination of initialization source and evaluation reason: | Initialization Sources | Evaluation Reason | |------------------------|-------------------| | Network | LocalOverride | | Bootstrap | Unrecognized | -| DataAdatper | Unsupported | +| DataAdapter | Unsupported | | StatsigNetwork | error | -| Uninitialized | | +| Uninitialized | "" | - `StatsigNetwork`: fetched from statsig API, most likely due to fallback behavior - `error`: an error happened during evaluation +- `""`: no evaluation reason means a successful check using the values from the source. In addition to these reasons, the most recent versions of server SDKs will also give you two times to watch: the time at which config definitions initialized the SDK, and the time at which the SDK was currently evaluating those definitions. When you change a gate/config/experiment, the project time will update From 53195b77504f8ab829ea705a0827149d2397ca63 Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:46:30 -0700 Subject: [PATCH 3/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index eaa912071..bdb37d495 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -66,7 +66,8 @@ In newer server SDKs, the reasons will be a combination of initialization source | StatsigNetwork | error | | Uninitialized | "" | -- `StatsigNetwork`: fetched from statsig API, most likely due to fallback behavior +- `StatsigNetwork`: this refers to when custom proxy/grpc streaming has triggered the fallback behavior, thus falling back to statsig api. + * If no network config/overrides were used, the sdk default uses statsig apis but the reason will be Network. - `error`: an error happened during evaluation - `""`: no evaluation reason means a successful check using the values from the source. From 0fdb276581e9c3a1562a4f8ec64f33114cbe2871 Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 11:54:13 -0700 Subject: [PATCH 4/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index bdb37d495..0b07f9f28 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -58,18 +58,20 @@ For server SDKs, these reasons for the value you are seeing can be: - `Uninitialized`: the sdk was not yet successfully initialized In newer server SDKs, the reasons will be a combination of initialization source and evaluation reason: -| Initialization Sources | Evaluation Reason | -|------------------------|-------------------| -| Network | LocalOverride | -| Bootstrap | Unrecognized | -| DataAdapter | Unsupported | -| StatsigNetwork | error | -| Uninitialized | "" | - +**Initialization Source** +- `Network` +- `Bootstrap` +- `DataAdapter` +- `Uninitialized` - `StatsigNetwork`: this refers to when custom proxy/grpc streaming has triggered the fallback behavior, thus falling back to statsig api. * If no network config/overrides were used, the sdk default uses statsig apis but the reason will be Network. + +**Evaluation Reason** +- `LocalOverride` +- `Unrecognized` +- `Unsupported` - `error`: an error happened during evaluation -- `""`: no evaluation reason means a successful check using the values from the source. +- no reason: successful evaluation In addition to these reasons, the most recent versions of server SDKs will also give you two times to watch: the time at which config definitions initialized the SDK, and the time at which the SDK was currently evaluating those definitions. When you change a gate/config/experiment, the project time will update From 1b9695af1bc1662a602527eedc95d91302e354df Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 12:55:16 -0700 Subject: [PATCH 5/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index 0b07f9f28..20c4eeec1 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -65,7 +65,6 @@ In newer server SDKs, the reasons will be a combination of initialization source - `Uninitialized` - `StatsigNetwork`: this refers to when custom proxy/grpc streaming has triggered the fallback behavior, thus falling back to statsig api. * If no network config/overrides were used, the sdk default uses statsig apis but the reason will be Network. - **Evaluation Reason** - `LocalOverride` - `Unrecognized` From 3b6df759fbb43cbb07128966d56caa164d3d1556 Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:01:22 -0700 Subject: [PATCH 6/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index 20c4eeec1..52c553a04 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -58,14 +58,15 @@ For server SDKs, these reasons for the value you are seeing can be: - `Uninitialized`: the sdk was not yet successfully initialized In newer server SDKs, the reasons will be a combination of initialization source and evaluation reason: -**Initialization Source** +Initialization Source - `Network` - `Bootstrap` - `DataAdapter` - `Uninitialized` - `StatsigNetwork`: this refers to when custom proxy/grpc streaming has triggered the fallback behavior, thus falling back to statsig api. * If no network config/overrides were used, the sdk default uses statsig apis but the reason will be Network. -**Evaluation Reason** + +Evaluation Reason - `LocalOverride` - `Unrecognized` - `Unsupported` From 24e8a6b29de6c3c77ba6959fff39733b34aa6740 Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:18:10 -0700 Subject: [PATCH 7/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index 52c553a04..2e93245aa 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -133,3 +133,12 @@ Android: Available with `Statsig.openDebugView()`. Available in [v4.29.0](https |Landing|Gates List|Gate Details|Experiment Details| |--|--|--|--| |![client-debugger-landing](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/fa6d7237-eb47-4f09-896c-696cfd5c956c)|![client-debugger-gates-list](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/161d8f35-a9b8-4ff9-b549-e04d04acac8a)|![client-debugger-gate-info](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/ab15e586-5259-4475-8f5c-018b2ab6e8db)|![client-debugger-experiment-details](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/920a6e8a-eb84-4d37-bf77-bb909a575d58)| + + +## SDK Dropping Events + +SDKs batches and flushes events in the background to our server. When the volume of input event is higher than the flushing volume, the SDK can drop events after so many retries. There are several things you can tune in statsig options to minimize event loss. +![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) +- event_queue_size: how many events to send in a single batch. +- retry_queue_size: how many batches of events to hold and retry for. + From daefd615ebcc01661995caea5cd67e786d941b43 Mon Sep 17 00:00:00 2001 From: kat-statsig <167801639+kat-statsig@users.noreply.github.com> Date: Thu, 24 Oct 2024 13:23:17 -0700 Subject: [PATCH 8/8] Update debugging.mdx --- docs/sdks/debugging.mdx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/sdks/debugging.mdx b/docs/sdks/debugging.mdx index 2e93245aa..4d4d446ff 100644 --- a/docs/sdks/debugging.mdx +++ b/docs/sdks/debugging.mdx @@ -135,10 +135,12 @@ Android: Available with `Statsig.openDebugView()`. Available in [v4.29.0](https |![client-debugger-landing](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/fa6d7237-eb47-4f09-896c-696cfd5c956c)|![client-debugger-gates-list](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/161d8f35-a9b8-4ff9-b549-e04d04acac8a)|![client-debugger-gate-info](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/ab15e586-5259-4475-8f5c-018b2ab6e8db)|![client-debugger-experiment-details](https://github.com/statsig-io/statsig-sdk-debugger-chrome-extension/assets/95646168/920a6e8a-eb84-4d37-bf77-bb909a575d58)| -## SDK Dropping Events - -SDKs batches and flushes events in the background to our server. When the volume of input event is higher than the flushing volume, the SDK can drop events after so many retries. There are several things you can tune in statsig options to minimize event loss. -![Python](https://img.shields.io/badge/python-3670A0?style=for-the-badge&logo=python&logoColor=ffdd54) -- event_queue_size: how many events to send in a single batch. -- retry_queue_size: how many batches of events to hold and retry for. +## SDK Event Handling and Minimizing Event Loss + +The SDK batches and flushes events in the background to our server. When the volume of incoming events exceeds the SDK's flushing capacity, some events may be dropped after a certain number of retries. To reduce the chances of event loss, you can adjust several settings in the Statsig options: +- Event Queue Size: Determines how many events are sent in a single batch. + - Increasing the event queue size allows more events to be flushed at once, but it will consume more memory. It's recommended not to exceed 1800 events per batch, as larger payloads may result in failed requests. +- Retry Queue Size: Specifies how many batches of events the SDK will hold and retry. + - By default, the SDK keeps 10 batches in the retry queue. Increasing this limit allows more batches to be retried, but also increases memory usage. +Tuning these options can help manage event volume more effectively and minimize the risk of event drops.