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

# parseTraceparent()

> Function exported by @botmesh/core/spi.

```ts theme={null}
function parseTraceparent(traceparent, tracestate?): SpanContextRef | undefined;
```

Defined in: [telemetry/w3c.ts:54](https://github.com/andresayac/botmesh/blob/main/packages/core/src/telemetry/w3c.ts#L54)

Parse a W3C `traceparent` (and an optional `tracestate`) into a remote span context, or
`undefined` when it is malformed. A `tracestate` longer than 512 chars is dropped.

## Parameters

| Parameter | Type |
| - | - |
| `traceparent` | `string` |
| `tracestate?` | `string` |

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