Skip to content

Commit

Permalink
Adds diagram showing trace instrumentation's role in architecture (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
adriancole authored Jan 13, 2017
1 parent 91aa9fa commit 8df450d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 0 deletions.
58 changes: 58 additions & 0 deletions pages/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,64 @@ Here's a diagram describing this flow:
To see if an instrumentation library already exists for your platform, see the
list of [existing instrumentations]({{ site.github.url}}/pages/existing_instrumentations).

Example flow
-----------------------

As mentioned in the overview, identifiers are sent in-band and details are sent
out-of-band to Zipkin. In both cases, trace instrumentation is responsible for
creating valid traces and rendering them properly. For example, a tracer ensures
parity between the data it sends in-band (downstream) and out-of-band (async to
Zipkin).

Here's an example sequence of http tracing where user code calls the resource
/foo. This results in a single span, sent asynchronously to Zipkin after user
code receives the http response.

```
┌─────────────┐ ┌───────────────────────┐ ┌─────────────┐ ┌──────────────────┐
│ User Code │ │ Trace Instrumentation │ │ Http Client │ │ Zipkin Collector │
└─────────────┘ └───────────────────────┘ └─────────────┘ └──────────────────┘
│ │ │ │
┌─────────┐
│ ──┤GET /foo ├─▶ │ ────┐ │ │
└─────────┘ │ record tags
│ │ ◀───┘ │ │
────┐
│ │ │ add trace headers │ │
◀───┘
│ │ ────┐ │ │
│ record timestamp
│ │ ◀───┘ │ │
┌─────────────────┐
│ │ ──┤GET /foo ├─▶ │ │
│X-B3-TraceId: aa │ ────┐
│ │ │X-B3-SpanId: 6b │ │ │ │
└─────────────────┘ │ invoke
│ │ │ │ request │
│ │ │ │ │
┌────────┐ ◀───┘
│ │ ◀─────┤200 OK ├─────── │ │
────┐ └────────┘
│ │ │ record duration │ │
┌────────┐ ◀───┘
│ ◀──┤200 OK ├── │ │ │
└────────┘ ┌────────────────────────────────┐
│ │ ──┤ asynchronously report span ├────▶ │
│ │
│{ │
│ "traceId": "ab", │
│ "id": "6b", │
│ "name": "get", │
│ "timestamp": 1483945573944000,│
│ "duration": 386000, │
│ "annotations": [ │
│--snip-- │
└────────────────────────────────┘
```

Trace instrumentation report spans asynchronously to prevent delays or failures
relating to the tracing system from delaying or breaking user code.

Transport
---------
Expand Down
6 changes: 6 additions & 0 deletions public/css/zipkin.css
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ figure.highlight pre code {
overflow-x: auto;
word-wrap: normal;
}
pre {
white-space: pre;
display: block;
overflow-x: auto;
word-wrap: normal;
}

/* Some tables need to be wide to make sense of them, even if it breaks the design and responsiveness */
table.wide-table td {
Expand Down

0 comments on commit 8df450d

Please sign in to comment.