mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-08 00:02:20 +03:00
merge: sync origin/main into release/v3.8.7 (keep newer analytics columns from main)
This commit is contained in:
@@ -404,7 +404,9 @@ export async function GET(request: Request) {
|
||||
latency_ms,
|
||||
connection_id,
|
||||
api_key_id,
|
||||
api_key_name
|
||||
api_key_name,
|
||||
combo_name,
|
||||
requested_model
|
||||
FROM usage_history
|
||||
${rawWhere}
|
||||
UNION ALL
|
||||
@@ -422,19 +424,22 @@ export async function GET(request: Request) {
|
||||
0 as latency_ms,
|
||||
NULL as connection_id,
|
||||
NULL as api_key_id,
|
||||
NULL as api_key_name
|
||||
NULL as api_key_name,
|
||||
NULL as combo_name,
|
||||
NULL as requested_model
|
||||
FROM daily_usage_summary
|
||||
${aggWhere}
|
||||
)`
|
||||
)`
|
||||
: `(SELECT
|
||||
timestamp, provider, model,
|
||||
tokens_input, tokens_output,
|
||||
tokens_cache_read, tokens_cache_creation, tokens_reasoning,
|
||||
service_tier, success, latency_ms,
|
||||
connection_id, api_key_id, api_key_name
|
||||
connection_id, api_key_id, api_key_name,
|
||||
combo_name, requested_model
|
||||
FROM usage_history
|
||||
${whereClause}
|
||||
)`;
|
||||
)`;
|
||||
|
||||
// When using the unified source the WHERE filters are already embedded inside.
|
||||
// For the original whereClause-based queries that still reference usage_history directly
|
||||
|
||||
Reference in New Issue
Block a user