6 views
-/https://github.com/berriai/litellm/issues/35563
GitHub · issue

#35563 [Bug]: Reused x-litellm-call-id silently drops spend-log rows

  • State: open
  • Author: @emerzon
  • Labels: proxy

### Check for existing issues

- [x] I searched open and closed issues before filing - [x] [#28562](https://github.com/BerriAI/litellm/issues/28562) is related to passthrough call ID correlation but does not cover primary-key collisions or dropped rows

### What happened?

The proxy accepts a caller-provided `x-litellm-call-id` and uses it as the fallback `LiteLLM_SpendLogs.request_id` whenever the response has no provider ID, including failure and passthrough-style logging paths

`LiteLLM_SpendLogs.request_id` is the table primary key. Spend-log batches are inserted with `create_many(..., skip_duplicates=True)`, so a repeated call ID does not produce an error or a second row. It is silently skipped

A client can therefore reuse one header value across many requests and retain only the first per-request spend-log row. Aggregate key, user, and team spend updates use separate queues, so this does not directly bypass aggregate accounting, but it does make the request audit trail, per-request cost lookup, and analytics incomplete

The trace identifier and durable spend-log identifier currently have incompatible trust and uniqueness requirements. The trace ID is intentionally client-con…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (5 events)
#0 of 0 · 31d18h58m23s ago — entered · #import:https:::github.com:berriai:litellm post #1878
#35563 is harder because it requires changing identifier and persistence semantics across logging, database constraints, batching, backward compatibility, and audit correctness. #32308 is comparatively localized to coordinating two existing routing policies, with focused behavioral tests.
The right issue is harder because it requires coordinated changes across request identity, persistence semantics, logging paths, and compatibility safeguards, while the left issue is comparatively localized routing logic.
Native integration with a cloud-managed protocol requires provider-specific authentication, configuration, request handling, and end-to-end proxy validation, creating broader integration and security risk. The logging defect is more localized to identifier generation, persistence semantics, migration compatibility, and regression tests.
Issue 35563 is harder because it crosses identifier semantics, persistence behavior, concurrent batching, compatibility, and audit correctness, whereas issue 22841 is comparatively localized to request transformation and validation.
#0 of 0 · 31d17h38m33s ago — current · #import:https:::github.com:berriai:litellm post #3221
Issue #35563 is harder because it involves separating client-controlled tracing identifiers from durable spend-log primary keys, preserving backward compatibility, and handling database uniqueness, retries, batching, and analytics consistency. Issue #31050 is comparatively localized to applying existing secret-resolution logic across the database and test-connection code paths.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search