mirror of
https://github.com/fawney19/Aether.git
synced 2026-10-05 00:47:48 +08:00
feat: 新增 frontdoor 执行回环守卫与多项可观测性增强
- 新增 frontdoor_loop_guard 模块,检测并拒绝 execution runtime 回环到本地网关的请求(HTTP 508) - candidate loop 引入 span tracking、执行尝试日志与流式看门狗超时 - 本地故障转移策略支持从 report_context 加载,新增 append_local_failover_policy_to_value - runtime tracing 美化:移除 identity 前缀,按 span 深度树形缩进,target 固定宽度展示 - Codex OpenAI CLI 补齐 chatgpt-account-id/x-client-request-id/session_id/conversation_id 请求头 - OpenAI CLI same/cross-format 聚合规则放宽以支持 openai:compact 客户端格式,并过滤 error-like 响应体 - auth/proxy/finalize 日志补充 user_id/api_key_id/api_key_name/balance_remaining 等字段 - 启动日志拆分为 starting/ready/config 三段,新增 resolve_bind_http_base_url - access_log middleware 将生成的 trace_id 回注到下游请求头 - Cargo.toml 启用 serde_json preserve_order 特性
This commit is contained in:
@@ -87,6 +87,13 @@ pub(super) fn finalize_gateway_response(
|
||||
.filter(|value| !value.trim().is_empty())
|
||||
.unwrap_or("-")
|
||||
.to_string();
|
||||
let auth_context = control_decision.and_then(|decision| decision.auth_context.as_ref());
|
||||
let user_id = auth_context
|
||||
.map(|auth_context| auth_context.user_id.as_str())
|
||||
.unwrap_or("-");
|
||||
let api_key_id = auth_context
|
||||
.map(|auth_context| auth_context.api_key_id.as_str())
|
||||
.unwrap_or("-");
|
||||
let status_code = response.status().as_u16();
|
||||
emit_admin_audit(
|
||||
&mut response,
|
||||
@@ -106,6 +113,8 @@ pub(super) fn finalize_gateway_response(
|
||||
remote_addr = %remote_addr,
|
||||
method = %method,
|
||||
path = %path_and_query,
|
||||
user_id,
|
||||
api_key_id,
|
||||
route_class,
|
||||
execution_path,
|
||||
dependency_reason = dependency_reason.as_str(),
|
||||
@@ -124,6 +133,8 @@ pub(super) fn finalize_gateway_response(
|
||||
remote_addr = %remote_addr,
|
||||
method = %method,
|
||||
path = %path_and_query,
|
||||
user_id,
|
||||
api_key_id,
|
||||
route_class,
|
||||
execution_path,
|
||||
dependency_reason = dependency_reason.as_str(),
|
||||
@@ -142,6 +153,8 @@ pub(super) fn finalize_gateway_response(
|
||||
remote_addr = %remote_addr,
|
||||
method = %method,
|
||||
path = %path_and_query,
|
||||
user_id,
|
||||
api_key_id,
|
||||
route_class,
|
||||
execution_path,
|
||||
dependency_reason = dependency_reason.as_str(),
|
||||
|
||||
Reference in New Issue
Block a user