@@ -33,6 +33,61 @@ Here's a diagram describing this flow:
3333To see if an instrumentation library already exists for your platform, see the
3434list of [ existing instrumentations] ({{ site.github.url}}/pages/existing_instrumentations).
3535
36+ Example flow
37+ -----------------------
38+
39+ As mentioned in the overview, identifiers are sent in-band and details are sent
40+ out-of-band to Zipkin. In both cases, trace instrumentation is responsible for
41+ creating valid traces and rendering them properly. For example, a tracer ensures
42+ parity between the data it sends in-band (downstream) and out-of-band (async to
43+ Zipkin).
44+
45+ Here's an example sequence of http tracing where "Application" calls the
46+ resource /foo. This results in a single span, sent asynchronously to Zipkin
47+ after call completes.
48+
49+ ```
50+ ┌─────────────┐ ┌───────────────────────┐ ┌─────────────┐ ┌──────────────────┐
51+ │ Application │ │ Trace Instrumentation │ │ Http Client │ │ Zipkin Collector │
52+ └─────────────┘ └───────────────────────┘ └─────────────┘ └──────────────────┘
53+ │ │ │ │
54+ ┌─────────┐
55+ │ ──┤GET /foo ├─▶ │ ────┐ │ │
56+ └─────────┘ │ record tags
57+ │ │ ◀───┘ │ │
58+ ────┐
59+ │ │ │ add trace headers │ │
60+ ◀───┘
61+ │ │ ────┐ │ │
62+ │ record timestamp
63+ │ │ ◀───┘ │ │
64+ ┌─────────────────┐
65+ │ │ ──┤GET /foo ├─▶ │ │
66+ │X-B3-TraceId: aa │ ────┐
67+ │ │ │X-B3-SpanId: 6b │ │ │ │
68+ └─────────────────┘ │ invoke
69+ │ │ │ │ request │
70+ │
71+ │ │ │ │ │
72+ ┌────────┐ ◀───┘
73+ │ │ ◀─────┤200 OK ├─────── │ │
74+ ────┐ └────────┘
75+ │ │ │ record duration │ │
76+ ┌────────┐ ◀───┘
77+ │ ◀──┤200 OK ├── │ │ │
78+ └────────┘ ┌────────────────────────────────┐
79+ │ │ ──┤ asynchronously report span ├────▶ │
80+ │ │
81+ │{ │
82+ │ "traceId": "ab", │
83+ │ "id": "6b", │
84+ │ "name": "get", │
85+ │ "timestamp": 1483945573944000,│
86+ │ "duration": 386000, │
87+ │ "annotations": [ │
88+ │--snip-- │
89+ └────────────────────────────────┘
90+ ```
3691
3792Transport
3893---------
0 commit comments