OpenInference JS
    Preparing search index...
    • 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.

      Parameters

      • context: Context

        The context to set the session ID on.

      • session: Session

        The session to set on the context.

      Returns Context

      The context

      context.with(
      setSession(context.active(), { sessionId: "session-123" }),
      () => {
      // Spans created here will have session ID attribute
      }
      );