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

# SpanStatus

# SpanStatus

Allowed status values for a [Span](/docs/reference/sdk/v2/typescript/classes/span).

## Import

```typescript theme={null}
import type { SpanStatus } from '@adaline/client';
```

## Definition

```typescript theme={null}
type SpanStatus = 'success' | 'failure' | 'aborted' | 'cancelled' | 'unknown';
```

***

## Values

| Value         | Description                                                                            |
| ------------- | -------------------------------------------------------------------------------------- |
| `'success'`   | The span completed successfully with the expected result.                              |
| `'failure'`   | The span encountered an error and did not produce a valid result.                      |
| `'aborted'`   | The span was terminated before completion due to an external signal (e.g., timeout).   |
| `'cancelled'` | The span was intentionally stopped by the caller before it finished.                   |
| `'unknown'`   | The status was not explicitly set. This is the **default** when no status is provided. |

<Note>
  `SpanStatus` does **not** include `'pending'`. The `'pending'` value is only available on [`TraceStatus`](/docs/reference/sdk/v2/typescript/types/TraceStatus), since a trace can represent an in-progress operation, while individual spans are expected to resolve before being flushed.
</Note>

***

## Usage

```typescript theme={null}
import { Adaline } from '@adaline/client';

const adaline = new Adaline();
const monitor = adaline.initMonitor({ projectId: 'my-project' });

const trace = monitor.logTrace({ name: 'Chat Request' });
const span = trace.logSpan({ name: 'LLM Call' });

try {
  const result = await callLLM();

  span.update({ status: 'success' });
  trace.update({ status: 'success' });
} catch (error) {
  span.update({ status: 'failure' });
  trace.update({ status: 'failure' });
} finally {
  span.end();
  trace.end();
}
```

***

## See Also

* [Span](/docs/reference/sdk/v2/typescript/classes/span) — the class that uses `SpanStatus`
* [Trace](/docs/reference/sdk/v2/typescript/classes/trace) — uses `TraceStatus`, which adds `'pending'`
