---
name: trazado-distribuido-jaeger-tempo
description: Implementa trazado distribuido con Jaeger y Tempo para rastrear solicitudes a través de microservicios e identificar cuellos de botella de rendimiento. Útil para depurar sistemas distribuidos y analizar flujos de peticiones con OpenTelemetry.
license: MIT
metadata:
  id: 29bf70a5
  slug: trazado-distribuido-jaeger-tempo
  titulo: "Trazado Distribuido con Jaeger y Tempo"
  servicio: IA-Ingenieria-MLOps
  categoria_recurso: Web-Desarrollo
  tipo: sistema
  nivel: avanzado
  idioma: es
  idioma_original: en
  acceso: gratis
  precio_eur: 0
  plataformas: [Jaeger, Grafana Tempo, OpenTelemetry, Python]
  dependencias: [prometheus-configuration, grafana-dashboards, slo-implementation]
  licencia: { spdx: MIT, redistribuible: true, uso_comercial: true }
  fuente:
    repo: wshobson/agents
    url: https://github.com/wshobson/agents/tree/main/plugins/observability-monitoring/skills/distributed-tracing
    commit: cc37bfd
    autor: wshobson
    nombre_original: distributed-tracing
    duplicados_en: []
  seguridad: { veredicto: seguro, riesgo: bajo, escaneado: "2026-06-14", motor: "grep-estatico+auditor-llm" }
  ficha:
    que_hace: "Guia la implementacion de trazado distribuido en microservicios para visualizar el recorrido completo de cada solicitud y detectar latencias o fallos."
    como_lo_hace: "Instrumenta el codigo con OpenTelemetry, exporta trazas a Jaeger o Tempo, y aplica buenas practicas de muestreo, etiquetado y correlacion de logs."
  content_hash: "29bf70a558eb0fba1f0c3e1ca08f9151bba1bf0693d4c533cfca0023179ac67f"
  version: 1.0.0
---

# Distributed Tracing

Implement distributed tracing with Jaeger and Tempo for request flow visibility across microservices.

## Purpose

Track requests across distributed systems to understand latency, dependencies, and failure points.

## When to Use

- Debug latency issues
- Understand service dependencies
- Identify bottlenecks
- Trace error propagation
- Analyze request paths

## Detailed patterns and worked examples

Detailed pattern documentation lives in `references/details.md`. Read that file when the navigation tier above is insufficient.

## Best Practices

1. **Sample appropriately** (1-10% in production)
2. **Add meaningful tags** (user_id, request_id)
3. **Propagate context** across all service boundaries
4. **Log exceptions** in spans
5. **Use consistent naming** for operations
6. **Monitor tracing overhead** (<1% CPU impact)
7. **Set up alerts** for trace errors
8. **Implement distributed context** (baggage)
9. **Use span events** for important milestones
10. **Document instrumentation** standards

## Integration with Logging

### Correlated Logs

```python
import logging
from opentelemetry import trace

logger = logging.getLogger(__name__)

def process_request():
    span = trace.get_current_span()
    trace_id = span.get_span_context().trace_id

    logger.info(
        "Processing request",
        extra={"trace_id": format(trace_id, '032x')}
    )
```

## Troubleshooting

**No traces appearing:**

- Check collector endpoint
- Verify network connectivity
- Check sampling configuration
- Review application logs

**High latency overhead:**

- Reduce sampling rate
- Use batch span processor
- Check exporter configuration


## Related Skills

- `prometheus-configuration` - For metrics
- `grafana-dashboards` - For visualization
- `slo-implementation` - For latency SLOs
