-
Notifications
You must be signed in to change notification settings - Fork 621
Closed
Labels
Description
Related to open-telemetry/opentelemetry-browser#23
This is a proposal to implement sessions for web. The session.id attribute is now defined in semantic conventions (link). The attribute should be added to any span or log generated by a web instrumentation.
Implementation proposal:
- implement
SessionIdSpanProcessorandSessionIdLogRecordProcessor - these two processors will have a dependency on a
SessionManager - when adding the attribute, the processors will get the session ID from the manager
- the manager is responsible for managing the session ID value (generating, persisting and expiring)
- we provide a default implementation of SessionManager that will use LocalStorage and configurable expiration
- users can provide their own implementation of a SessionManager
- all of this functionality will live in a new package called
web-common
SessionManager interface
export interface SessionManager {
getSessionId(): string
}A prototype of this proposal is available here.
Prior implementations:
- the OTel demo app already has a similar implementation
I am looking for any feedback on this approach. If there are no objections, I will open a PR in line with the prototype implementation.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done