Add INFO-level session reuse logging per request#20597
Merged
AlexsanderHamir merged 1 commit intomainfrom Feb 6, 2026
Merged
Conversation
- Log when shared aiohttp session is attached to each request - Log when no shared session is available - Visible at INFO level (production-safe)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Greptile OverviewGreptile Summary
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| litellm/proxy/route_llm_request.py | Adds INFO-level logging around shared aiohttp session reuse/absence in the request routing path; introduces a likely mismatch between log message intent and actual condition (can incorrectly log 'reuse' when a new per-request session is created). |
Sequence Diagram
sequenceDiagram
participant Client
participant Proxy as LiteLLM Proxy
participant Router as LLM Router
participant SessionMgr as aiohttp Session Manager
Client->>Proxy: HTTP request (LLM completion/chat)
Proxy->>Router: route_llm_request(...)
Router->>SessionMgr: get_shared_aiohttp_session()
alt Shared session available
SessionMgr-->>Router: aiohttp.ClientSession
Router->>Router: attach session to per-request call
Router->>Proxy: log INFO "shared session attached"
else No shared session
SessionMgr-->>Router: None
Router->>Proxy: log INFO "no shared session available"
end
Router-->>Proxy: forward request to provider
Proxy-->>Client: response
Comment on lines
+100
to
102
| from litellm._logging import verbose_proxy_logger | ||
| from litellm.proxy.proxy_server import shared_aiohttp_session | ||
|
|
Contributor
There was a problem hiding this comment.
Logging is too noisy
This adds an INFO log on every request in add_shared_session_to_data, both when a shared session is present and when it isn’t. In production this will flood logs and materially increase log volume/cost, especially since the PR description calls this “production-safe”. This should be downgraded to DEBUG (or gated behind an opt-in flag / sampling) so normal traffic doesn’t emit per-request log lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/directory, Adding at least 1 test is a hard requirement - see detailsmake test-unitCI (LiteLLM team)
Branch creation CI run
Link:
CI run for the last commit
Link:
Merge / cherry-pick CI run
Links:
Type
🧹 Refactoring
Changes