Sets the user ID in the given OpenTelemetry context.
The context to set the user ID on.
The user to set on the context.
The context
context.with( setUser(context.active(), { userId: "user-123" }), () => { // Spans created here will have user ID attribute }); Copy
context.with( setUser(context.active(), { userId: "user-123" }), () => { // Spans created here will have user ID attribute });
Sets the user ID in the given OpenTelemetry context.