Sets the session ID in the given OpenTelemetry context. If OI tracer is used in spans created during this active context, the session ID will be added to the span as an attribute.
The context to set the session ID on.
The session to set on the context.
The context
context.with( setSession(context.active(), { sessionId: "session-123" }), () => { // Spans created here will have session ID attribute }); Copy
context.with( setSession(context.active(), { sessionId: "session-123" }), () => { // Spans created here will have session ID attribute });
Sets the session ID in the given OpenTelemetry context. If OI tracer is used in spans created during this active context, the session ID will be added to the span as an attribute.