feat(request-details): implement observability settings and enhance request detail tracking

- Added new observability settings in the dashboard for max records, batch size, flush interval, and max JSON size.
- Introduced `extractRequestConfig` function to capture full request configurations.
- Enhanced error handling by saving detailed request information on failures.
- Updated usage tracking to include new token metrics.
- Modified streaming functions to support detailed content and reasoning tracking.
This commit is contained in:
decolua
2026-02-09 10:20:24 +07:00
parent 635d327dbc
commit cbabf5547c
14 changed files with 1647 additions and 40 deletions
+5 -5
View File
@@ -312,11 +312,11 @@ export function logUsage(provider, usage, model = null, connectionId = null) {
// Save to usage DB
const tokens = {
input: inTokens,
output: outTokens,
cacheRead: cacheRead || 0,
cacheCreation: cacheCreation || 0,
reasoning: reasoning || 0
prompt_tokens: inTokens,
completion_tokens: outTokens,
cache_read_input_tokens: cacheRead || 0,
cache_creation_input_tokens: cacheCreation || 0,
reasoning_tokens: reasoning || 0
};
saveRequestUsage({ model, provider, connectionId, tokens }).catch(() => { });
appendRequestLog({ model, provider, connectionId, tokens, status: "200 OK" }).catch(() => { });