Skip to content

docs: document request_correlation_in_logs and StandardLoggingPayload.session_id - #645

Merged
yassin-berriai merged 4 commits into
BerriAI:mainfrom
deepanshululla:docs/logging-contextvar-request-correlation
Aug 10, 2026
Merged

yassin-berriai merged 4 commits into
BerriAI:mainfrom
deepanshululla:docs/logging-contextvar-request-correlation

Conversation

@deepanshululla

Copy link
Copy Markdown
Contributor

Summary

Documents the opt-in request_correlation_in_logs flag added in BerriAI/litellm#34418, which stamps proxy log lines (plaintext or JSON) with the request's trace_id and session_id, and adds an independent session_id field to StandardLoggingPayload

Changes

New "Request Correlation IDs" section in docs/proxy/debugging.md, covering the config flag, example plaintext and JSON log lines, and a pointer to the new StandardLoggingPayload field

New table row for request_correlation_in_logs in docs/proxy/config_settings.md, alongside the existing json_logs entry

New session_id row in the StandardLoggingPayload field table in docs/proxy/logging_spec.md

….session_id

Covers the opt-in trace_id/session_id stamping added to litellm's proxy
logging: the litellm_settings flag, plaintext and JSON log examples, and
the new independent session_id field on StandardLoggingPayload.
@vercel

vercel Bot commented Jul 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
litellm Ready Ready Preview, Comment Jul 29, 2026 5:57pm

Request Review

…_logs

Documents the control-character-stripping and 256-char length bound added
to set_trace_id/set_session_id (litellm/_logging.py) so callers aren't
surprised by a modified or truncated custom session id.
The corresponding OSS PR scoped the feature to the async path (the proxy and
litellm.acompletion()) after review found a cross-request log misattribution
bug specific to the sync entry point on a reused thread pool worker. Sync
support is planned as a follow-up rather than shipped here.
…lation

request_correlation_in_logs now falls back to the standard W3C Trace Context
traceparent header and W3C Baggage header when the litellm-specific headers
aren't set, so a caller with existing OpenTelemetry instrumentation gets
matching trace_id/session_id values instead of an unrelated generated id.
@yassin-berriai
yassin-berriai merged commit dad824e into BerriAI:main Aug 10, 2026
3 checks passed

This branch was successfully deployed

1 active deployment
Preview — a4cc6db3 Deployed Jul 29, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants