docs: add dedicated session management guide - #343
Conversation
dc4f479 to
e343a2c
Compare
| await sessionManager.start(); | ||
|
|
||
| startBrowserSdk({ | ||
| serviceName: 'my-service', |
There was a problem hiding this comment.
When we pass our own processors here but no exportConfig, the SDK does not add an OTLP exporter (the check in startTracesSdk.ts and startLogsSdk.ts is !config.processors || config.exportConfig). So this Quick Start sets session.id on spans and logs but never exports them. @martinkuba what do you think?
| serviceName: 'my-service', | |
| serviceName: 'my-service', | |
| exportConfig: { url: 'https://your-collector.example.com' }, |
There was a problem hiding this comment.
Following up, this is the only thread here still open. Sorry, I bundled two different things into one comment, which is probably why it stalled.
For the doc: the Quick Start passes processors without exportConfig, and the SDK only adds the OTLP exporter when !config.processors || config.exportConfig (startTracesSdk.ts:51, startLogsSdk.ts:58), so as written the example sets session.id but never exports anything. Adding exportConfig makes the example work, so let's just do that and not block on anything else.
For whether the SDK should keep the default exporter when processors are passed: that is a separate SDK question and does not belong on a docs PR. I opened #376 for it, so this one can move.
3cedeb6 to
b10a26a
Compare
|
@overbalance Just a small bump on this 😄 I've addressed all of the requested documentation changes in the latest commit! The only remaining discussion is the Quick Start example regarding exportConfig, where I was waiting for guidance since it was tagged for @martinkuba's input. If you'd prefer me to update the example now, I'm happy to make that change as well. Otherwise, I'll wait for the decision on that discussion! Whenever you have a chance, I'd appreciate another look. Thanks! |
Which problem is this PR solving?
Closes #114
This PR adds dedicated documentation for browser session management to improve discoverability and provide a more comprehensive reference than the existing SDK README!
Previously, session management was only documented as a brief section inside
packages/sdk/README.md, making it difficult for users to understand the available APIs, lifecycle, configuration options, extension points, and implementation details!Short description of the changes
Added
docs/session-management.mdguide covering:SessionManagerconfigurationSessionStoreimplementationsSessionProviderimplementationsUpdated
packages/sdk/README.mdby keeping it focused on quick-start usage and linking to the new dedicated guide for detailed documentation.README.mdlinking to:This keeps detailed documentation centralized under the
docs/directory while preserving a concise onboarding experience in the SDK README.Type of change
How Has This Been Tested?
npm test) to ensure no regressionsChecklist