Skip to main content

Traces module · writer API

ZipkinTraceWriter

Convert the shared five-table OTLP Arrow projection into Zipkin v2 span arrays or trace-grouped JSON.

What it writes

Export shared trace data to Zipkin clients.

ZipkinTraceWriter reconstructs endpoints, annotations, and span relationships from the normalized Arrow tables, with either span-array or trace-grouped output.

Input

The five-table OtlpTrace projection

Spans

A flat array of Zipkin spans

Traces

Arrays grouped by trace ID

Context

Local, remote, and event annotations

Detailed guide

ZipkinTraceWriter reference

The sections below document usage, output shapes, formatting options, reconstruction, and fidelity limits.

ZipkinTraceWriter converts the shared OtlpTrace Arrow projection into Zipkin v2 JSON.

import {encode, load} from '@loaders.gl/core';
import {ZipkinTraceLoader, ZipkinTraceWriter} from '@loaders.gl/traces/zipkin';

const trace = await load('trace.zipkin.json', ZipkinTraceLoader);
const spans = await encode(trace, ZipkinTraceWriter, {
zipkinTrace: {shape: 'spans', space: 2}
});
OptionTypeDefaultDescription
zipkinTrace.shape'spans' | 'traces''spans'Emit one span array or a list of arrays grouped by trace ID.
zipkinTrace.spacenumber0Spaces used to pretty-print JSON.

The writer reconstructs local endpoints from resources, remote endpoints from compatibility attributes, and annotations from OTLP events. See the Zipkin format page for mappings and fidelity limits.