litellm/tests/test_litellm/proxy/spend_tracking
yassin fad11fa66e fix(proxy): keep client User-Agent on auth failure spend logs
Auth gate rejections are raised before add_litellm_data_to_request stamps the caller User-Agent and SpendLogsMetadata dropped the field, so failure spend logs and prometheus labels could not identify an abusive client. Stamp requester_ip_address and user_agent on the failure hook payload and carry user_agent through spend log metadata. Request scopes without a headers entry are tolerated.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-09-15 21:02:06 +00:00
..
test_budget_reservation.py feat(rust): count tiktoken cl100k_base admission tokens in Rust (#40777) 2026-09-11 23:47:05 +00:00
test_budget_reservation_redis_failure.py perf(proxy): pipeline spend counter increments into one Redis call per request (#40371) 2026-09-09 10:35:50 -07:00
test_carried_budget_state.py perf(proxy): one MGET and one pipeline for post-call spend counters, no team/user/org refetch on the response path (#40841) 2026-09-12 16:05:50 +00:00
test_cloudzero_endpoints.py test: drop the cwd-relative sys.path.insert calls from the test suite (#37802) 2026-08-22 09:25:58 -07:00
test_compression_savings.py feat(spend): track prompt compression saved tokens in daily spend aggregates (#33810) 2026-07-18 17:47:54 -07:00
test_key_metadata_recovery.py fix(spend-tracking): bound the spend-log scan with a statement timeout and name only unanimous alias, team, and owner 2026-09-08 17:24:22 -07:00
test_ptu_feature_flag.py feat(ptu): gate PTU flat-cost attribution behind an opt-in env var (#36138) 2026-08-10 12:23:20 -07:00
test_ptu_flat_cost_rollup.py test(ptu): drop the assertion on the flag removed upstream 2026-08-23 10:02:41 +00:00
test_savings.py fix(spend): compare auto-router targets by deployment identity (#40206) 2026-09-07 23:29:42 -07:00
test_spend_counter_batch.py perf(proxy): one MGET and one pipeline for post-call spend counters, no team/user/org refetch on the response path (#40841) 2026-09-12 16:05:50 +00:00
test_spend_event.py feat(proxy): offload spend tracking to a pod-local collector sidecar (#40545) 2026-09-10 17:14:13 -07:00
test_spend_event_producer.py feat(proxy): offload spend tracking to a pod-local collector sidecar (#40545) 2026-09-10 17:14:13 -07:00
test_spend_log_error_logger.py feat(spend-logs): opt-in suppression of stack traces in spend-tracking error logs 2026-05-02 00:44:34 +00:00
test_spend_management_endpoints.py fix(proxy): keep client User-Agent on auth failure spend logs 2026-09-15 21:02:06 +00:00
test_spend_query_optimization.py perf(proxy): total a short grouped log page from the page itself 2026-09-11 14:51:05 -07:00
test_spend_tracking_utils.py fix(proxy): keep client User-Agent on auth failure spend logs 2026-09-15 21:02:06 +00:00