Prompt
What should I use to correlate logs with traces and metrics?
Latest observation
Oct 28, 2026
OpenAI APIWeb search: off
Use OpenTelemetry as your main correlation standard.
Why OpenTelemetry
It gives you a common way to instrument:
- traces
- metrics
- logs
And it lets you correlate them using shared context, especially:
- trace_id
- span_id
- service name
- resource attributes like environment, version, cluster, etc.
Practical recommendation
If you want logs to correlate with traces and metrics:
- Instrument your app with OpenTelemetry
- Propagate trace context across services using W3C Trace Context
- Include trace/span IDs in logs
- Send everything to a backend that supports cross-signaling, such as:
- Grafana stack
- Datadog
- New Relic
- Splunk Observability
- Elastic Observability
- Azure Monitor / Application Insights
- Honeycomb
What to put in logs
At minimum, include:
trace_idspan_idservice.namedeployment.environmentversionorservice.version
Best practice
Use a structured log format like JSON so correlation fields are easy to query.
Short answer
OpenTelemetry + trace/span IDs in structured logs is the standard way to correlate logs, traces, and metrics.
If you want, I can also show you:
- how this works in a specific language, or
- what fields to include in your log schema.