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
Known 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
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp