mirror of
https://github.com/BerriAI/litellm.git
synced 2026-12-04 01:48:57 +00:00
* feat(traces): render curated SQL examples from shared files * fix(traces): filter trace-summary example after grouping so boundary-spanning traces keep full totals Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(traces): order failed-spans example by timestamp so newest failures survive the limit Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Yujong Lee <yujong@berri.ai> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
10 lines
376 B
SQL
10 lines
376 B
SQL
SELECT
|
|
team_id, api_key, trace_id, count() AS requests,
|
|
countIf(isNull(spend) OR NOT isFinite(spend)) AS unknown_cost_requests,
|
|
if(unknown_cost_requests = 0, sum(spend), NULL) AS recorded_spend
|
|
FROM spend_logs FINAL
|
|
WHERE start_time >= now() - INTERVAL 1 DAY
|
|
AND trace_id != ''
|
|
GROUP BY team_id, api_key, trace_id
|
|
ORDER BY team_id, api_key, trace_id
|
|
LIMIT 100
|