Skip to content

Instantly share code, notes, and snippets.

@codefromthecrypt
Created January 2, 2017 07:39
Show Gist options
  • Save codefromthecrypt/5ec532ddc68eb7a0d5d0e18714b5821c to your computer and use it in GitHub Desktop.
Save codefromthecrypt/5ec532ddc68eb7a0d5d0e18714b5821c to your computer and use it in GitHub Desktop.
example tracing flow made with textik
I made this with https://textik.com in attempts to explain how service naming work. Since english is
second language for many coders, diagrams help. In this case, achieved understanding in <20 minutes!
The tracer on Server A starts a trace since is doesn't read
headers or anything from the browser's request. In zipkin
this has annotation "sr" with the serviceName "loginService"
-\
-\ Server A has role loginService, so its tracer is named that.
Browser -\+--------------+
+--------+ -\ |
| | | -\ Trace : loginService
| +---+| | -+-------+ |
| | || sends to server | | | |
| | -------------------------| | | | next request is to the
| | ||No trace context yet | | --- profile service +--------------+
| +---+| | | | |\-- | |
| | | | +-------+ | \---- | Tracer : profileService
+-----|--+ | | \---- | +-------+ |
| +--------------+ \----- | | | |
| this request \-| | | |
| is traced, so has | | | |
| trace headers present | | | |
Many times the browser doesn't have | +-------+ |
tracing. But it can using zipkin-js This request is in a | |
child span in the same +--------------+
trace as the one from
the browser. it starts
with "cs" from loginService and includes "sr" "ss" from profileService
@codefromthecrypt
Copy link
Author

in this diagram, the trace would have 2 spans
root would have "sr" "ss" from loginService
child would have "cs" and "cr" from loginService and "sr" ss" from profileService
(the actual servers don't matter, would only be different ip addresses)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment