Istio Distributed Tracing shows just 1 span
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Istio Distributed Tracing Shows Just 1 Span
Istio, an open-source service mesh, is a vital component in cloud-native application architectures for managing microservices operations, including traffic management, security, and observability. Distributed tracing is a pivotal aspect of observability, enabling developers and operators to monitor and troubleshoot systems. However, a common challenge encountered with Istio's observability features, particularly distributed tracing, is when only one span is displayed for a complex operation involving multiple microservices. This article delves into why this happens and how to resolve it.
Understanding Distributed Tracing with Istio
Istio leverages Envoy as its proxy, injecting it into service pods as sidecar containers. Envoy intercepts all inbound and outbound traffic, enabling it to collect detailed telemetry data, which Istio uses to provide metrics, logging, and tracing capabilities.
Key Concepts
- Span: Represents a single operation within a trace. Contains metadata about the operation, such as its start and end time, and the service handling the operation.
- Trace: Represents the progress of a request as it moves through different services in a distributed system, composed of multiple spans.
Why Only One Span?
Several factors might cause Istio distributed tracing to show just a single span rather than a detailed trace with multiple spans across microservices:
- Trace Context Propagation: For distributed tracing to work effectively, trace context (trace ID and span IDs) must propagate across service boundaries. If a service or API does not pass these headers correctly, individual calls result in separate, disconnected spans.
- Instrumentation: The application services must be instrumented using an appropriate OpenTelemetry library to ensure they participate in trace context propagation.
- Misconfiguration in Envoy: Incorrectly set tracing configurations in Istio or Envoy can lead to issues where traces are not properly captured and propagated.
- Sampling Rate: A low sampling rate might discard spans, resulting in incomplete traces.
- Mixed Protocols: If services communicate using multiple protocols (e.g., gRPC and HTTP), ensuring consistent tracing headers across protocols is crucial for complete traces.
Technical Examples & Troubleshooting
Example: Inspecting Headers for Propagation
An example of checking headers for trace propagation between two services, service-a and service-b, might look like this:
Related reading
- Java time-based map/cache with expiring keys
- Jobs in the queue(pub-sub) distributed systems with dependencies?
- Julia Distributed, failed to modify the global variable of the worker
- Julia Distributed slow down to half the single core performance when adding process
- Java 11 on AWS beanstalk for Spring boot project
- Java health monitoring in clustered environment
- Julia Parallel Distributed
- kafka-node several consumers

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.