Distributed Tracing
Ahnlich supports distributed tracing using OpenTelemetry for production observability.
Quick Enable
Add these flags to enable tracing:
# For Ahnlich DB
ahnlich-db run \
--enable-tracing \
--otel-endpoint http://jaeger:4317
# For Ahnlich AI
ahnlich-ai run \
--enable-tracing \
--otel-endpoint http://jaeger:4317
Docker Compose Example
version: "3.8"
services:
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- "16686:16686" # Jaeger UI
- "4317:4317" # OTLP gRPC receiver
ahnlich_db:
image: ghcr.io/deven96/ahnlich-db:latest
command: >
ahnlich-db run --host 0.0.0.0
--enable-tracing
--otel-endpoint http://jaeger:4317
ports:
- "1369:1369"
ahnlich_ai:
image: ghcr.io/deven96/ahnlich-ai:latest
command: >
ahnlich-ai run --host 0.0.0.0
--db-host ahnlich_db
--enable-tracing
--otel-endpoint http://jaeger:4317
ports:
- "1370:1370"
Access Jaeger UI at http://localhost:16686
What Gets Traced
- Client requests and responses
- DB operations (similarity search, indexing)
- AI model inference (embedding generation)
- Inter-service communication (AI → DB)
Detailed Documentation
For comprehensive tracing setup and configuration:
- Distributed Tracing Overview - Architecture and concepts
- Using Jaeger - Jaeger setup guide
- Tracing in Ahnlich DB - DB-specific configuration
- Tracing in Ahnlich AI - AI-specific configuration
Production Tips
- Use a dedicated collector - Don't send traces directly to Jaeger in production
- Sample traces - Configure sampling to reduce overhead (not yet configurable, coming soon)
- Aggregate traces - Use centralized tracing backends (Jaeger, Tempo, Honeycomb)
- Monitor overhead - Tracing adds ~5-10% latency overhead