Skip to content

Revert "fix: proxy failure cases, now log ip and user agent, key hash, name" - #20413

Merged
Sameerlite merged 1 commit into
litellm_oss_staging_02_03_2026from
revert-20145-fix/proxy_failure_cases
Feb 4, 2026
Merged

Revert "fix: proxy failure cases, now log ip and user agent, key hash, name"#20413
Sameerlite merged 1 commit into
litellm_oss_staging_02_03_2026from
revert-20145-fix/proxy_failure_cases

Conversation

@Sameerlite

Copy link
Copy Markdown
Contributor

Reverts #20145

All db related tests started failing after this: https://app.circleci.com/pipelines/github/BerriAI/litellm/57025/details

@vercel

vercel Bot commented Feb 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
litellm Building Building Preview, Comment Feb 4, 2026 11:47am

Request Review

@Sameerlite
Sameerlite merged commit 674593e into litellm_oss_staging_02_03_2026 Feb 4, 2026
2 of 3 checks passed
@greptile-apps

greptile-apps Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR reverts changes from #20145 that were causing database-related test failures. The revert restores the previous behavior across authentication, logging, and metrics collection.

Key changes being reverted:

  • Prometheus metrics filtering: Restores filtering of 401 authentication errors from metrics (prevents invalid auth attempts from polluting monitoring data)
  • HTTP status codes: Changes model access denied errors from 400 back to 401 for team/user/org/vector store access checks
  • Error logging context: Removes client context enrichment (IP address, user-agent, hashed token, token name) from auth error logs
  • Error type tracking: Simplifies _is_proxy_only_llm_api_error to only track auth_error type instead of multiple access-denied error types

Behavior implications:

The revert trades off observability improvements (detailed auth failure logging) for test stability. After this revert:

  • Failed authentication attempts with 401 status will not appear in Prometheus metrics
  • Auth error logs will contain less diagnostic information
  • Model access denied errors will return 401 instead of 400, affecting Prometheus filtering behavior

Confidence Score: 4/5

  • Safe to merge - clean revert addressing test failures, though trades observability for stability
  • This is a straightforward revert commit that cleanly undoes changes from PR fix: proxy failure cases, now log ip and user agent, key hash, name #20145. The revert is justified by database test failures in CircleCI. The changes are internally consistent and restore well-tested previous behavior.
  • Pay attention to litellm/proxy/auth/auth_checks.py - the status code changes from 400 to 401 for model access errors will affect Prometheus metrics behavior

Important Files Changed

Filename Overview
litellm/integrations/prometheus.py Reverts behavior to skip 401 auth errors from metrics instead of tracking all requests
litellm/proxy/auth/auth_checks.py Changes HTTP 400 to 401 for model access denied errors (team/user/org/vector store access)
litellm/proxy/auth/auth_exception_handler.py Removes client context (IP, user-agent, key hash, key name) from auth error logging

Sequence Diagram

sequenceDiagram
    participant Client
    participant ProxyAPI
    participant AuthModule
    participant LoggingModule
    participant MetricsModule
    
    Client->>ProxyAPI: HTTP Request
    ProxyAPI->>AuthModule: Authenticate request
    
    alt Valid Authentication
        AuthModule-->>ProxyAPI: Return UserAPIKeyAuth
        ProxyAPI->>Client: Process request
    else Invalid Authentication
        AuthModule->>LoggingModule: Log error
        Note over LoggingModule: Simplified context logging
        LoggingModule->>MetricsModule: Record failure
        
        alt HTTP 401
            Note over MetricsModule: REVERT: Skip from metrics
            MetricsModule->>MetricsModule: Skip recording
        else HTTP 400
            Note over MetricsModule: Record in Prometheus
            MetricsModule->>MetricsModule: Record metrics
        end
        
        AuthModule-->>ProxyAPI: Raise exception
        ProxyAPI->>Client: Error response
    end
Loading

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@ishaan-berri
ishaan-berri deleted the revert-20145-fix/proxy_failure_cases branch March 26, 2026 22:30
fzowl pushed a commit to fzowl/litellm that referenced this pull request Jun 24, 2026
…failure_cases

Revert "fix: proxy failure cases, now log ip and user agent, key hash, name"
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.

1 participant