# OtlpExporter

**Kind:** Class

**Source:** [`atloria-monorepo/libs/agent-core/src/tracing/otlp-exporter.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/agent-core/src/tracing/otlp-exporter.ts#L51)

## Methods

| Method | Signature | Returns |
|---|---|---|
| `startSpan` | `startSpan(operationName: string, parentSpanId: string)` | `TraceSpan` |
| `endSpan` | `endSpan(span: TraceSpan, status: 'ok' | 'error')` | `void` |
| `addEvent` | `addEvent(span: TraceSpan, name: string, attributes: Record<string, string | number | boolean>)` | `void` |
| `setAttributes` | `setAttributes(span: TraceSpan, attributes: Record<string, string | number | boolean>)` | `void` |
| `flush` | `flush()` | `Promise<void>` |
| `getPendingCount` | `getPendingCount()` | `number` |
| `shutdown` | `shutdown()` | `Promise<void>` |

## Where it refuses work

- `OtlpExporter` stops the work with an early return when `!this.config.enabled || this.spans.length === 0`.

## When something fails

- `OtlpExporter` handles failure in 2 places: it logs it and continues in 1, and discards it silently in 1. A failure discarded silently leaves no trace for whoever debugs this later.
