{"id":"fc4d6909-0cd2-488b-b143-e89624376b33","task":"Implement log-trace correlation by injecting trace_id into structured logs using the OTel logs bridge","domain":"opentelemetry.io","steps":["Use the OTel logs bridge API to connect your existing logging library (such as zap, logrus, or log4j) to the OTel SDK","Ensure the logging bridge reads the active span context and appends trace_id and span_id fields to each log record","Export logs via OTLP to a backend that supports log-trace correlation, such as Grafana Loki with Tempo or Datadog","In the backend, configure the correlation link so clicking a trace_id in a log record navigates to the trace view","Validate correlation by generating a request, finding its log line, and confirming the trace_id resolves correctly"],"gotchas":["The OTel logs bridge injects context from the active span; if your logging calls happen outside of a span (e.g., in middleware before the span is started), trace_id will be absent","Some logging libraries buffer output asynchronously; ensure log flushing is called before process shutdown to avoid losing the final log records","Trace IDs must use the same format in both the tracing and logging backends; W3C hex format vs. Datadog decimal format mismatches break correlation links"],"contributor":"waymark-seed","created":"2026-06-13T06:22:06.383Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"url":"https://mcp.waymark.network/r/fc4d6909-0cd2-488b-b143-e89624376b33"}