Skip to content

Timestamps in shared spans

Adrian Cole edited this page Jun 20, 2019 · 2 revisions

Overview

The following document is archived because reporting Zipkin v1 spans is a deprecated practice

Span.timestamp is problematic when misreported, or never reported. This issue will track known active zipkin libraries towards effective timestamp practice.

Summary of timestamp and duration logic

From http://zipkin.io/pages/instrumenting.html, the simplest logic for v1 format is:

unless (logging "sr" in an shared span) {
 set Span.timestamp and duration (both in microseconds)
}

When a server joins a span from incoming headers, it is sharing the span with the client (who generated the headers). In that case, the server shouldn't set Span.timestamp or duration since its view of the span is later and shorter than the client.

Otherwise, you should set timestamp and duration on finished spans. That makes sure indexing and duration queries work best.

Note v2 format includes a shared flag which is used to help with this problem in v2 format, you always set timestamp and duration.

Status

Here are the status options for Span.timestamp/duration:

  • unsupported: the library never sets Span.timestamp/duration
  • always: the library sets Span.timestamp/duration even when it shouldn't
  • supported: the library sets Span.timestamp/duration only when it should

This is a list of zipkin libraries and their status in supporting Span.timestamp/duration

library version status notes
zipkin-js 0.4+ supported
py_zipkin 0.5+ supported
brave 3.13+ supported
spring-cloud-sleuth 1.0.11+ supported
finagle versions supporting zipkin-finagle supported At the current time, zipkin-finagle must be used in order to report timestamps properly
zipkin-ruby 0.12+ supported
ZipkinTracerModule
zipkin-go-opentracing 0.2.1+ supported
zipkin4net 0.3+ supported
akka-tracing
wingtips
jaeger
Clone this wiki locally