Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update debugging.mdx #2227

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions docs/sdks/debugging.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,22 @@ 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 source and evaluation reason:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmmm. At first I wanted to combine all of this but I see why its separate. Can you make a heading for the client and server sdk sections?

So

Client SDK Reasons

Server SDK Reasons

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`
Comment on lines +62 to +72
Copy link
Contributor

@tore-statsig tore-statsig Oct 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either add a definition for each of them, or none of them. In this case, each of them would be best

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the definition for the rest of them are above, i only added for the new ones we introduced in v2. I re-listed them these enums have been shifted to reason vs source

- `error`: an error happened during evaluation
- 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
and server SDKs will download the new definition. If you have not changed your project in two hours, and the evaluation time is saying
Expand Down Expand Up @@ -117,3 +133,14 @@ 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 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this only applies to python at the moment. Id document it in the python sdk docs instead of in a generic debugging section. If you do leave it here, then it should specify which sdk type/version it applies to

- 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.

Loading