> ## 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](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/span.md).

## 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`](https://www.adaline.ai/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.

***

## 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](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/span.md) — the class that uses `SpanStatus`
* [Trace](https://www.adaline.ai/docs/reference/sdk/v2/typescript/classes/trace.md) — uses `TraceStatus`, which adds `'pending'`


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