0
0
HLDsystem_design~12 mins

Distributed tracing in HLD - Architecture Diagram

Choose your learning style9 modes available
System Overview - Distributed tracing

Distributed tracing helps track a user's request as it moves through many services in a system. It shows where delays happen and helps find errors quickly. The system must collect trace data from services, store it, and let users search and view traces easily.

Architecture Diagram
User
  |
  v
Load Balancer
  |
  v
API Gateway
  |
  v
+-------------------+       +----------------+
|   Service A       |<----->| Trace Collector |
+-------------------+       +----------------+
          |
          v
+-------------------+
|   Service B       |
+-------------------+
          |
          v
+-------------------+
|   Service C       |
+-------------------+
          |
          v
+-------------------+
| Distributed Storage|
+-------------------+
          |
          v
+-------------------+
| Trace Query Engine |
+-------------------+
          |
          v
User Interface (UI)
Components
User
user
Initiates requests and views trace results
Load Balancer
load_balancer
Distributes incoming requests to API Gateway
API Gateway
api_gateway
Entry point for requests, routes to services
Service A
service
Handles part of the request and generates trace data
Service B
service
Processes request further and generates trace data
Service C
service
Final service in chain, generates trace data
Trace Collector
service
Receives trace data from services and forwards to storage
Distributed Storage
database
Stores trace data for querying and analysis
Trace Query Engine
service
Processes user queries to retrieve trace data
User Interface (UI)
frontend
Allows users to search and view distributed traces
Request Flow - 12 Hops
UserLoad Balancer
Load BalancerAPI Gateway
API GatewayService A
Service ATrace Collector
Service AService B
Service BTrace Collector
Service BService C
Service CTrace Collector
Trace CollectorDistributed Storage
UserTrace Query Engine
Trace Query EngineDistributed Storage
Trace Query EngineUser Interface (UI)
Failure Scenario
Component Fails:Trace Collector
Impact:Trace data from services is lost or delayed, making tracing incomplete or unavailable
Mitigation:Use multiple Trace Collector instances with load balancing and buffering at services to retry sending trace data
Architecture Quiz - 3 Questions
Test your understanding
Which component is responsible for storing the collected trace data?
ADistributed Storage
BTrace Collector
CAPI Gateway
DLoad Balancer
Design Principle
This architecture shows how distributed tracing collects data from multiple services asynchronously to avoid slowing down user requests. It uses a centralized storage and query engine to let users explore traces, helping find performance issues across complex systems.