Skip to main content
By default, Openlayer treats each request as a standalone trace. With users and sessions, you can connect those traces into journeys — making it easier to see how people interact with your system across time. Sessions and users A session represents a series of related interactions (e.g., a multi-turn chatbot conversation). While a user is the individual behind one or more sessions, identified by an ID. In the Openlayer UI, you can filter and group traces by session_id or user_id to:
  • Inspect full conversation threads.
  • Track user journeys end-to-end.
  • Identify problematic patterns tied to specific users or flows.

How add session and user

There are two ways to attach user/session information:

1. Set default context

Set the context once (e.g., in middleware) and all traces created in that request will inherit it.

2. Override context for specific traces

If you only want to set context for certain traces, use update_trace_user_session().