Atatus Python APM Agent allows you to correlate application logs with traces by automatically adding identifiers such as trace.id, transaction.id, and span.id. This makes it easier to move from a log entry to the exact trace or error inside the Atatus dashboard.

Log Correlation

Log correlation lets you trace individual requests across systems by automatically adding correlation identifiers (trace, transaction, and span IDs) to your logs. With log correlation enabled, the Atatus Python Agent automatically injects these identifiers into your application logs: These IDs connect your logs with traces, making it easy to jump from a log entry to its related transaction in the Atatus dashboard.

How Log Correlation Works in Atatus

Atatus integrates with the built-in Python logging module to:
  • Automatically add correlation fields to log records
  • Support plain-text and structured logs (JSON)
  • Keep original log format intact while appending tracing metadata

Setting Up Log Correlation in Python

Use the AtatusFormatter to enrich logs with trace context.
Example log output:

Structlog Integration

For applications using structlog, the Atatus agent provides a dedicated processor that adds correlation identifiers to structured log events.
Example log output: