$docker.recipes

Zipkin

beginner

Distributed tracing system for latency analysis and troubleshooting.

[i]Overview

Zipkin is an open-source distributed tracing system originally developed by Twitter, designed to help developers understand the flow of requests through microservice architectures. It collects timing data from applications to identify latency problems and visualize how requests propagate across multiple services, making it invaluable for debugging complex distributed systems. Zipkin implements the OpenTracing standard and uses B3 propagation headers to correlate spans across service boundaries. This Zipkin deployment provides a complete tracing infrastructure with an intuitive web interface for trace visualization and analysis. The system accepts trace data from applications via HTTP endpoints and stores timing information to help identify bottlenecks, failed requests, and performance degradation across your service mesh. Zipkin's lightweight architecture makes it particularly effective for capturing and analyzing request flows in real-time. Development teams working with microservices, site reliability engineers debugging production issues, and platform teams implementing observability solutions will find Zipkin essential for understanding system behavior. The configuration uses in-memory storage for immediate setup and testing, while the web interface at port 9411 provides powerful search capabilities to filter traces by service, operation, duration, and custom tags.

[*]Key Features

  • [+]Distributed trace collection with B3 propagation header support for cross-service correlation
  • [+]Interactive web UI for searching, filtering, and visualizing request traces across services
  • [+]JSON and Protobuf span ingestion via REST API endpoints for flexible client integration
  • [+]Service dependency mapping showing relationships and communication patterns between microservices
  • [+]Trace timeline visualization with detailed span information including duration and metadata
  • [+]In-memory storage backend for development and testing environments
  • [+]Support for custom tags and annotations to enrich trace data with business context
  • [+]Configurable sampling rates and trace retention policies for performance optimization

[#]Common Use Cases

  • [1]Debugging latency issues in microservice architectures by identifying slow service calls
  • [2]Root cause analysis for failed requests across distributed systems and API gateways
  • [3]Performance optimization by analyzing request patterns and identifying bottlenecks
  • [4]Service dependency discovery and mapping for complex distributed applications
  • [5]Development environment tracing to understand application flow during feature development
  • [6]Production monitoring for SLA compliance and performance regression detection
  • [7]Integration testing verification to ensure proper trace propagation across service boundaries

[!]Prerequisites

  • [!]Docker Engine 20.10+ and Docker Compose V2 for container orchestration
  • [!]Minimum 512MB RAM allocation for trace storage and web interface operation
  • [!]Port 9411 available for Zipkin web UI and API endpoint access
  • [!]Application instrumentation with Zipkin-compatible tracing libraries
  • [!]Basic understanding of distributed tracing concepts and span relationships
  • [!]Network connectivity from monitored applications to Zipkin collector endpoint
[!]

WARNING: For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms

[$]docker-compose.yml

[docker-compose.yml]
1services:
2 zipkin:
3 image: openzipkin/zipkin:latest
4 container_name: zipkin
5 restart: unless-stopped
6 environment:
7 STORAGE_TYPE: mem
8 ports:
9 - "9411:9411"
10 networks:
11 - zipkin-network
12
13networks:
14 zipkin-network:
15 driver: bridge

[$].env Template

[.env]
1STORAGE_TYPE=mem

[i]Usage Notes

  1. [1]Docs: https://zipkin.io/
  2. [2]UI at http://localhost:9411 - search and view traces
  3. [3]In-memory storage by default - use Elasticsearch/Cassandra for production
  4. [4]Send traces to POST /api/v2/spans in JSON or Protobuf
  5. [5]B3 propagation format - widely supported in tracing libraries
  6. [6]Lightweight and simple - good starting point for tracing

[>]Quick Start

[terminal]
1# 1. Create the compose file
2cat > docker-compose.yml << 'EOF'
3services:
4 zipkin:
5 image: openzipkin/zipkin:latest
6 container_name: zipkin
7 restart: unless-stopped
8 environment:
9 STORAGE_TYPE: mem
10 ports:
11 - "9411:9411"
12 networks:
13 - zipkin-network
14
15networks:
16 zipkin-network:
17 driver: bridge
18EOF
19
20# 2. Create the .env file
21cat > .env << 'EOF'
22STORAGE_TYPE=mem
23EOF
24
25# 3. Start the services
26docker compose up -d
27
28# 4. View logs
29docker compose logs -f

[>]One-Liner

Run this command to download and set up the recipe in one step:

[terminal]
1curl -fsSL https://docker.recipes/api/recipes/zipkin/run | bash

[?]Troubleshooting

  • [!]Zipkin UI shows no traces: Verify applications are sending spans to http://zipkin:9411/api/v2/spans and check instrumentation configuration
  • [!]Container exits with memory errors: Increase Docker memory limits or switch to external storage backend like Elasticsearch
  • [!]Traces appear incomplete or missing spans: Check B3 header propagation in HTTP clients and ensure all services forward tracing headers
  • [!]High memory usage with in-memory storage: Configure ZIPKIN_STORAGE_MEM_MAX_SPANS environment variable or implement trace sampling
  • [!]Cannot access web interface: Verify port 9411 mapping and check firewall rules blocking access to Zipkin container
  • [!]Slow trace queries in web UI: Reduce trace retention time or migrate to persistent storage backend for better query performance

Community Notes

Loading...
Loading notes...

## Download Recipe Kit

Get all files in a ready-to-deploy package

Includes docker-compose.yml, .env template, README, and license