Zero-dependency Web Component that renders OpenTelemetry traces as an interactive waterfall timeline, with built-in log-to-trace transformation.
Most distributed systems already produce logs. Tools like Jaeger, Zipkin, and Grafana Tempo can visualize traces, but they require adopting new infrastructure, exporting data to an external platform, and instrumenting each service. Log2Trace takes a different approach: transform the logs you already have.
<trace-visualizer> is a custom HTML element that reads raw log records, applies a configurable field mapping to discover trace structure, and renders an interactive waterfall timeline — all client-side. Data never leaves the browser.
The element accepts logs in any JSON shape. You describe your log schema once via HTML attributes (or a JavaScript config object), and the component handles grouping, hierarchy, timing, and layout automatically.
Via CDN (no build step required):
<script type="module" src="https://unpkg.com/log2trace-ui@1.0.0-RC1/dist/log2trace.js"></script>
Via npm:
npm install log2trace-ui
Add the element to any HTML page and point it at your log data:
<script type="module" src="https://unpkg.com/log2trace-ui@1.0.0-RC1/dist/log2trace.js"></script>
<trace-visualizer
data-url="./logs.json"
trace-id-field="correlationId"
span-group-fields="service,operation"
span-name-field="operation"
service-name-field="service"
timestamp-field="timestamp"
status-code-field="errorCode"
parent-span-lookup-fields="calledBy"
show-legend
></trace-visualizer>
Each attribute is a dot-path into your log records (e.g. text.Application, resource.attributes.host for nested fields). The component groups logs into traces, builds a span hierarchy from parent references, and renders the result as a zoomable, pannable waterfall.
You can also configure the component and feed data programmatically via the JavaScript API — see the Interactive Demo Guide for live examples, or the API Reference for full type documentation.
TraceVisualizerConfig, TransformConfig, and all exported typestransformLogs(logs, config) converts an arbitrary log array into an OpenTelemetry TraceData object in five phases:
traceIdField valuespanGroupFields keyparentSpanLookupFields values against other span groups to establish the call hierarchyResourceSpans → ScopeSpans → Spans per the OTel protocolEvery original log entry is preserved as an OpenTelemetry event on its parent span, so clicking any span in the timeline shows the exact log lines that produced it.
MIT