> ## Documentation Index
> Fetch the complete documentation index at: https://botmesh.afaya.com.co/llms.txt
> Use this file to discover all available pages before exploring further.

# BotSpan

> Interface exported by @botmesh/core.

Defined in: [telemetry/types.ts:85](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L85)

One span, as the core drives it.

## Methods

### setAttribute()

```ts theme={null}
setAttribute(key, value): this;
```

Defined in: [telemetry/types.ts:86](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L86)

#### Parameters

| Parameter | Type |
| - | - |
| `key` | `string` |
| `value` | \| [`TraceAttributeValue`](https://botmesh.afaya.com.co/api/core/type-aliases/TraceAttributeValue) \| `undefined` |

#### Returns

`this`

***

### setAttributes()

```ts theme={null}
setAttributes(attrs): this;
```

Defined in: [telemetry/types.ts:87](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L87)

#### Parameters

| Parameter | Type |
| - | - |
| `attrs` | [`TraceAttributes`](https://botmesh.afaya.com.co/api/core/type-aliases/TraceAttributes) |

#### Returns

`this`

***

### addEvent()

```ts theme={null}
addEvent(name, attrs?): this;
```

Defined in: [telemetry/types.ts:88](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L88)

#### Parameters

| Parameter | Type |
| - | - |
| `name` | `string` |
| `attrs?` | [`TraceAttributes`](https://botmesh.afaya.com.co/api/core/type-aliases/TraceAttributes) |

#### Returns

`this`

***

### recordException()

```ts theme={null}
recordException(error): this;
```

Defined in: [telemetry/types.ts:90](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L90)

The core passes a sanitized error (see [SpanException](https://botmesh.afaya.com.co/api/core/interfaces/SpanException.md)).

#### Parameters

| Parameter | Type |
| - | - |
| `error` | [`SpanException`](https://botmesh.afaya.com.co/api/core/interfaces/SpanException) |

#### Returns

`this`

***

### setStatus()

```ts theme={null}
setStatus(status): this;
```

Defined in: [telemetry/types.ts:91](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L91)

#### Parameters

| Parameter | Type |
| - | - |
| `status` | [`SpanStatus`](https://botmesh.afaya.com.co/api/core/interfaces/SpanStatus) |

#### Returns

`this`

***

### end()

```ts theme={null}
end(endTimeMs?): void;
```

Defined in: [telemetry/types.ts:92](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L92)

#### Parameters

| Parameter | Type |
| - | - |
| `endTimeMs?` | `number` |

#### Returns

`void`

***

### isRecording()

```ts theme={null}
isRecording(): boolean;
```

Defined in: [telemetry/types.ts:94](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L94)

`false` when sampled out: the core then skips computing optional attributes (id hashing).

#### Returns

`boolean`

***

### spanContext()

```ts theme={null}
spanContext(): SpanContextRef | undefined;
```

Defined in: [telemetry/types.ts:95](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/types.ts#L95)

#### Returns

[`SpanContextRef`](https://botmesh.afaya.com.co/api/core/interfaces/SpanContextRef) | `undefined`


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