> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# SessionTracer

> Observes an existing session's live updates and Cognition extension notifications and records each turn as spans.

Observes an existing session's live updates and Cognition extension
notifications and records each turn as spans. Record the prompt text with
`SessionTracer.recordPrompt` before sending it; the ACP stream does
not echo the driving client's own prompt. Prefer [traceSessions](https://docs.devin.ai/sdk/reference/functions/traceSessions.md),
which records prompts itself.

## Constructor

```typescript
SessionTracer(session: TraceableSession, options?: TraceSessionOptions): SessionTracer
```

### Parameters

**session** `TraceableSession` *required*

**options** `TraceSessionOptions`

### Returns

`SessionTracer`

## Methods

### end()

```typescript
end(): Promise<void>
```

Stop observing, end any unfinished turn, and restore `onExtension`. Flush
the tracer provider afterwards to export before the process exits.

#### Returns

`Promise<void>`

### recordPrompt()

```typescript
recordPrompt(input: string): void
```

The prompt text for the next turn, recorded as its input.

#### Parameters

**input** `string` *required*


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.