Design: Distributed Tracing System for Microservices
Design the tracing collection, storage, and visualization system. Instrumentation libraries and microservice code changes are out of scope.
Functional Requirements
Non-Functional Requirements
Jump into concepts and practice - no test required
+----------------+ +----------------+ +----------------+
| Microservice A |-----> | Microservice B |-----> | Microservice C |
+----------------+ +----------------+ +----------------+
| | |
| | |
v v v
+---------------------------------------------------------------+
| Instrumentation Libraries |
+---------------------------------------------------------------+
|
v
+--------------------+
| Trace Collector(s) |
| (Jaeger/Zipkin Agent)|
+--------------------+
|
v
+--------------------+
| Storage Backend |
| (Elasticsearch/Cassandra) |
+--------------------+
|
v
+--------------------+
| Query API & UI |
| (Jaeger/Zipkin UI) |
+--------------------+Jaeger or Zipkin in microservices?X-B3-TraceId and X-B3-SpanId to pass trace info between services.Authorization, Content-Type, or Cookie are unrelated to tracing context propagation.Span A (root): start=0ms, duration=50ms Span B (child of A): start=10ms, duration=20ms Span C (child of A): start=35ms, duration=10ms