Jaeger Distributed Tracing with Elasticsearch Backend — Docker Compose Setup and Usage Guide
Overview
This setup deploys Jaeger tracing infrastructure integrated with Elasticsearch as the storage backend using Docker Compose. It enables robust trace data storage, querying, and management, facilitating distributed application performance monitoring and troubleshooting.- Jaeger: All-in-one image serving collector, query, and UI.
- Elasticsearch: Persistent storage for Jaeger trace data, configured with disk watermark thresholds and health checks.
Docker Compose Configuration (docker-compose.yml)
Setup Instructions
Prerequisites
- Docker and Docker Compose installed on the host machine.
- At least 2 CPU cores and 4GB RAM recommended for smooth Elasticsearch operation.
- Sufficient disk space (preferably >20GB free) for Elasticsearch indices.
Steps
-
Save the above YAML content as
docker-compose.ymlin your working directory. -
Start the stack:
-
Verify services are running:
-
Access Jaeger UI via browser at:
http://localhost:16686 -
Check Elasticsearch health:
Managing Traces via Elasticsearch API
Since Jaeger stores spans and traces in Elasticsearch indices, you can query and manage them directly using Elasticsearch REST APIs.Sample GET request to fetch trace data for a service
Sample DELETE request to delete trace indices for a specific date
Note: Deleting indices removes all data within those indices irreversibly. Use with caution.
Send Data to Jaeger Collector (Optional)
Summary
This setup provides a scalable and manageable tracing backend with:- Persistent Elasticsearch storage with disk watermark management.
- Health checks to ensure Elasticsearch readiness before Jaeger startup.
- Jaeger UI and API endpoints exposed for trace data ingestion and querying.
- Flexibility to manage trace data directly via Elasticsearch REST APIs.
If you require further automation or advanced management (e.g., index lifecycle policies), Elasticsearch’s official documentation and Jaeger’s index cleaner tool can be integrated accordingly.
