Sessions are one of the most important concepts in PandaProbe. A session groups multiple related traces under a sharedDocumentation Index
Fetch the complete documentation index at: https://docs.pandaprobe.com/llms.txt
Use this file to discover all available pages before exploring further.
session_id, so you can understand the full lifecycle of an agent instead of inspecting each trace in isolation.
In PandaProbe, you can think of a session as the unit for an agent. In practice, it represents an agent run, conversation, workflow, or other multi-step interaction that may produce many traces over time.
Use a stable
session_id for every trace that belongs to the same agent lifecycle. We recommend UUIDs so sessions are unique, safe to store, and easy to join back to your own systems.Why sessions matter
Individual traces show what happened during one operation. Sessions show how the agent behaved across the whole interaction. This matters because many agent failures are only visible across multiple steps:- A tool call succeeds, but the agent ignores the result later.
- The agent recovers from an error after several retries.
- Quality degrades across a long conversation.
- A workflow completes successfully, but uses too many steps or tokens.
When to create a new session
Create a newsession_id whenever a new agent lifecycle begins. Common examples include:
- A new chat conversation
- A new agent task or workflow run
- A new support ticket handled by an agent
- A new autonomous background job
session_id for every trace produced during that lifecycle.
Context managers (scoped)
Preferpandaprobe.session() when you can scope a session to a block of code. The session is applied to all traces created inside the block and is reset when the block exits.
Imperative API (global)
Useset_session() when a request or worker context needs to set the session once before calling into application code.
Explicit parameters (highest precedence)
When using decorators or context managers, explicit parameters always take precedence over scoped or global values:Precedence rules
- Explicit parameters passed to
@trace,start_trace(), or integration constructors - Context manager scope (
pandaprobe.session()) - Imperative setting (
pandaprobe.set_session())
Works across all layers
Session IDs propagate to wrappers, integrations, and manual instrumentation. Integration constructors also acceptsession_id:

