openzipkin/zipkin · error · Error

Trace ${modelview.traceId} is missing a timestamp

Error message

Trace ${modelview.traceId} is missing a timestamp

What it means

Thrown by zipkin-lens's detailedTraceSummary when getTraceTimestampAndDuration returns no timestamp for the trace. Like the traceSummary variant, the detailed (waterfall) model requires at least one span with a timestamp to establish the trace's absolute start; otherwise the trace cannot be rendered. This is the same invariant enforced at the detailed-view layer.

Source

Thrown at zipkin-lens/src/zipkin/trace.js:266

    });
  } else {
    spanRow.left = 0;
  }
}

// TODO: Revisit naming
export function detailedTraceSummary(root) {
  const serviceNameToCount = {};
  let queue = root.queueRootMostSpans();
  const modelview = {
    traceId: queue[0].span.traceId,
    depth: 0,
    spans: [],
  };

  const { timestamp, duration } = getTraceTimestampAndDuration(root);
  if (!timestamp)
    throw new Error(`Trace ${modelview.traceId} is missing a timestamp`);

  while (queue.length > 0) {
    let current = queue.shift();

    // This is more than a normal tree traversal, as we are merging any server spans that share the
    // same ID. When that's the case, we pull up any of their children as if they are our own.
    const spansToMerge = [current.span];
    const children = [];
    current.children.forEach((child) => {
      if (current.span.id === child.span.id) {
        spansToMerge.push(child.span);
        child.children.forEach((grandChild) => children.push(grandChild));
      } else {
        children.push(child);
      }
    });

    // Pulling up children may affect our sort order. We re-sort to ensure rows are added in

View on GitHub (pinned to 878ce2a1fa)

Solutions

  1. Guarantee the root/server spans include timestamp (microseconds) before sending them to Zipkin.
  2. If converting from another format, populate timestamp from your event time field.
  3. Validate the raw span list with a pre-check (some span has timestamp) before invoking detailedTraceSummary.

Example fix

// before
const root = buildTree([{ traceId: 'a', id: 'a', name: 'root' }]);
detailedTraceSummary(root); // throws

// after
const root = buildTree([{ traceId: 'a', id: 'a', name: 'root', timestamp: 1700000000000000 }]);
detailedTraceSummary(root);
Defensive patterns

Strategy: validation

Validate before calling

const spans = collectSpans(root);
if (!spans.some((s) => typeof s.timestamp === 'number')) return showError('trace missing timestamp');

Type guard

const renderableTrace = (spans) => spans.length > 0 && spans.some((s) => typeof s?.timestamp === 'number');

Prevention

When it happens

Trigger: Calling detailedTraceSummary(rootSpanNode) on a span tree where all spans lack a timestamp field — e.g. building the detailed view from a fixture or from data where timestamps were never set or were removed.

Common situations: Rendering the trace waterfall from spans produced by stub instrumentation without clocks; a custom span producer (e.g. log-to-trace converter) that omits timestamp; partial data after storage truncation.

Related errors


AI-assisted analysis of openzipkin/zipkin@878ce2a1fa (2026-08-14). Data as JSON: /api/errors/7e732022326f2e77. Report an issue: GitHub.