Skip to content

Sessions & Metadata

A session groups related LLM calls together, such as a user conversation, agent run, or batch job. Assign a session ID and all traces with that ID appear as a timeline in the dashboard.

Pass sessionId in observe options. All calls through this client use this session.

const client = observe(
new OpenAI({ apiKey: "sk-..." }),
Provider.OpenAI,
{ sessionId: "conv-abc-123" }
);

Pass pulseSessionId in the request body to override the observe-time session for one call.

await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Hello" }],
pulseSessionId: "different-session-456",
});

Per-call values take precedence. pulseSessionId is stripped before the request reaches the provider.

Attach arbitrary key-value data to traces for filtering by user, feature, environment, or any custom dimension.

const client = observe(
new OpenAI({ apiKey: "sk-..." }),
Provider.OpenAI,
{
metadata: {
userId: "user-123",
environment: "production",
},
}
);

Pass pulseMetadata in request body. It merges with observe-time metadata and per-call values win on conflicts.

await client.chat.completions.create({
model: "gpt-4o",
messages: [{ role: "user", content: "Summarize this" }],
pulseMetadata: {
feature: "summarizer",
version: "2.1",
},
});

The third argument to observe():

FieldTypeDescription
sessionIdstringDefault session ID for all calls through the client.
metadataRecord<string, unknown>Metadata merged into every trace from this client.

These request fields are stripped before sending to the provider:

FieldTypeDescription
pulseSessionIdstringOverride session ID for this call only.
pulseMetadataRecord<string, unknown>Merge additional metadata for this call.

In the dashboard, navigate to Sessions to see traces grouped by session ID and ordered by timestamp.

Via API:

Terminal window
GET /v1/sessions/:id

Returns all traces for the session. See REST API.