main:删除 Grafana 仪表板配置文件

更新内容:
- 移除 `dashboard.json` 文件,清理不再需要的 Grafana 仪表板配置。
- 简化项目目录结构,删除多余的监控配置以优化维护。
This commit is contained in:
2026-02-02 18:40:16 +08:00
parent 3e1d850954
commit 683bf8a6ca
20 changed files with 2103 additions and 18 deletions

View File

@@ -2,7 +2,7 @@
from fastapi import Header, HTTPException
from typing import Optional
from ..core.tracing import set_request_id, generate_request_id
from ..core.tracing import set_request_id, generate_request_id, get_request_id as get_current_request_id
async def get_request_id(x_request_id: Optional[str] = Header(None)) -> str:
@@ -15,6 +15,12 @@ async def get_request_id(x_request_id: Optional[str] = Header(None)) -> str:
Returns:
str: 请求ID
"""
# 先检查 ContextVar 中是否已经有 request_id由中间件设置
existing_request_id = get_current_request_id()
if existing_request_id:
return existing_request_id
# 如果没有,则从请求头获取或生成新的
request_id = x_request_id or generate_request_id()
set_request_id(request_id)
return request_id