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.
BufferedEntry
The type for items held in the Monitor’s internal buffer before they are flushed to the Adaline API.
Import
import type { BufferedEntry } from '@adaline/client';
Definition
type BufferedEntry =
| { ready: boolean; category: 'trace'; data: Trace }
| { ready: boolean; category: 'span'; data: Span };
Fields
| Field | Type | Description |
|---|
ready | boolean | Whether the entry is ready to be flushed. An entry becomes ready when end() is called on the trace or span. |
category | 'trace' | 'span' | Discriminant that identifies the entry type. |
data | Trace | Span | The trace or span instance held in the buffer. |
Usage
Access the monitor’s buffer property to inspect buffered entries. This is useful for debugging flush behavior or verifying that traces and spans are being queued correctly.
import { Adaline } from '@adaline/client';
import type { BufferedEntry } 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' });
// Inspect the buffer before ending
const buffer: BufferedEntry[] = monitor.buffer;
for (const entry of buffer) {
if (entry.category === 'trace') {
console.log(`Trace "${entry.data.trace.trace.name}" — ready: ${entry.ready}`);
} else {
console.log(`Span "${entry.data.span.span.name}" — ready: ${entry.ready}`);
}
}
// After ending, entries become ready for flushing
span.end();
trace.end();
See Also
- Monitor — manages the buffer and flush lifecycle
- Trace — buffered as
category: 'trace'
- Span — buffered as
category: 'span'