mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-12 23:01:41 +00:00
test(vertex passthrough): surface unparseable spend log startTime
A row that matches the model and spend > 0 but whose startTime can't be parsed was silently skipped, so a future /spend/logs format change would time out with the "cost-tracking write was lost" message instead of pointing at the timestamp. Print the offending value when that happens; matching behaviour is unchanged
This commit is contained in:
parent
1b0031dada
commit
cd7e99cd15
1 changed files with 7 additions and 1 deletions
|
|
@ -163,7 +163,13 @@ async def get_request_spend_log(
|
|||
if float(row.get("spend") or 0.0) <= 0:
|
||||
continue
|
||||
row_start = _parse_spend_log_start_time(row.get("startTime"))
|
||||
if row_start is not None and row_start >= after_time:
|
||||
if row_start is None:
|
||||
print(
|
||||
f"matching row has unparseable startTime {row.get('startTime')!r}",
|
||||
row,
|
||||
)
|
||||
continue
|
||||
if row_start >= after_time:
|
||||
print(f"found spend log (elapsed={elapsed}s)", row)
|
||||
return row
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue