OpenInference JS
    Preparing search index...
    • Sets the user ID in the given OpenTelemetry context.

      Parameters

      • context: Context

        The context to set the user ID on.

      • user: User

        The user to set on the context.

      Returns Context

      The context

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