@@ -33,6 +33,61 @@ Here's a diagram describing this flow:
33
33
To see if an instrumentation library already exists for your platform, see the
34
34
list of [ existing instrumentations] ({{ site.github.url}}/pages/existing_instrumentations).
35
35
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. Notice timing data is reported to
46
+ Zipkin after the application response is completed.
47
+
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
+ └─────────────────┘ │ remote
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
+ ```
36
91
37
92
Transport
38
93
---------
0 commit comments