> ## 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.

# BotTracer

> Interface exported by @botmesh/core.

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

The ONLY thing a tracing integration implements. Minimal on purpose, so it can be
backed by OpenTelemetry (`@botmesh/otel`), Datadog, Sentry or a test recorder.

## Methods

### startSpan()

```ts theme={null}
startSpan(name, options?): BotSpan;
```

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

#### Parameters

| Parameter | Type |
| - | - |
| `name` | `string` |
| `options?` | [`SpanOptions`](https://botmesh.afaya.com.co/api/core/interfaces/SpanOptions) |

#### Returns

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

***

### withSpan()?

```ts theme={null}
withSpan?<T>(span, fn): T;
```

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

Optional: run `fn` with `span` active in the backend's own context too, so the
backend's auto-instrumentations (http, pg, undici…) nest under bot spans. Must call
`fn` synchronously and return its result unchanged.

#### Type Parameters

| Type Parameter |
| - |
|  `T` |

#### Parameters

| Parameter | Type |
| - | - |
| `span` | [`BotSpan`](https://botmesh.afaya.com.co/api/core/interfaces/BotSpan) |
| `fn` | () => `T` |

#### Returns

`T`


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