LoggingHandler, which also attaches trace_id and span_id automatically inside an active span.
structlog
Route structlog through the standard library logger (which carries the OTelLoggingHandler from the Python page) and render each event as JSON so its key/value pairs reach Bronto as structured fields:
loguru
loguru bypasses stdlib logging, so add the OTelLoggingHandler as a loguru sink. Use enqueue=True so logging never blocks your application:
LoggingHandler reads the active span context, so logs emitted inside a span are correlated to their trace automatically — no manual trace_id handling needed.
Verify in Bronto
Open Search and filter by theservice.name you set on the Python page. Emit a log from your app and confirm it appears within a few seconds.
Troubleshooting
- No logs? Confirm the base OTel setup from the Python page runs at startup (the
LoggerProvider, exporter, and root-logger handler). - structlog output not structured? Keep
JSONRenderer()as the final processor and usestructlog.stdlib.LoggerFactory(). - loguru logs blocking or lost on exit? Keep
enqueue=True, and calllogger.remove()on shutdown so the queue drains before the process exits.

