Skip to content
_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN DE
Let's talk

Distributed Tracing — Patterns and Best Practices

17. 05. 2025 Updated: 24. 03. 2026 1 min read intermediate

DevOps Intermediate

Distributed Tracing — Patterns and Best Practices

Distributed TracingObservabilityMicroservices 5 min read

Principles of distributed tracing. Context propagation, span design, correlation IDs and debugging in practice.

Why Distributed Tracing

In a monolith, a stack trace is enough. In microservices, a request passes through dozens of services — without tracing, debugging is a nightmare.

  • Trace — the entire path of a request through the system
  • Span — a single operation (HTTP call, DB query)
  • Context Propagation — passing trace IDs between services

Context Propagation

# W3C Trace Context (standard)
traceparent: 00-4bf92f3577b34da6a3ce929d0e0e4736-00f067aa0ba902b7-01
tracestate: vendor=value

# In code (Go + OTel)
import "go.opentelemetry.io/otel/propagation"

// Middleware automatically extracts/injects context
handler := otelhttp.NewHandler(mux, "api-server")

// When calling a downstream service
ctx := r.Context()
req, _ := http.NewRequestWithContext(ctx, "GET", url, nil)
otel.GetTextMapPropagator().Inject(ctx, propagation.HeaderCarrier(req.Header))

Span Design

  • Name spans by operation: HTTP GET /api/orders
  • Add meaningful attributes: order.id, user.id
  • Use span events for important moments
  • Set status to ERROR with error description
  • Don’t over-granulate — a span per for-loop iteration is an anti-pattern

Summary

Distributed tracing is essential for debugging and performance analysis of microservices. W3C Trace Context is the standard, OpenTelemetry the best implementation.

Need Help with Implementation?

Our team has experience designing and implementing modern architectures. We’re happy to help.

Free Consultation

Share:

CORE SYSTEMS team

We build core systems and AI agents that keep operations running. 15 years of experience with enterprise IT.