功能实现: 1. 创建监控模块 (monitoring.py) - 系统健康检查 - 系统性能指标(CPU、内存、磁盘) - 服务统计信息(Agent、执行、工具、用户) - 性能趋势分析 - 系统告警 2. 添加监控API端点 - GET /api/v1/monitoring/metrics - 系统性能指标 - GET /api/v1/monitoring/stats - 服务统计信息 - GET /api/v1/monitoring/trends - 性能趋势数据 - GET /api/v1/monitoring/alerts - 系统告警 - GET /api/v1/monitoring/dashboard - 监控仪表板 3. 优化健康检查API - 使用监控模块统一管理健康检查 4. 添加依赖 - psutil==5.9.6 (系统资源监控) 5. 生成API文档 - Docs/项目文档/API接口文档_监控功能.md - 包含完整的API说明、请求/响应示例、集成示例 监控功能: - 实时系统资源监控(CPU、内存、磁盘) - 服务指标统计(24小时/7天) - 性能趋势分析(支持多种时间范围和间隔) - 智能告警系统(资源告警、服务告警) - 聚合监控仪表板
65 lines
978 B
Plaintext
65 lines
978 B
Plaintext
# Web框架
|
|
fastapi>=0.104.1
|
|
uvicorn[standard]==0.24.0
|
|
pydantic==2.5.0
|
|
pydantic-settings==2.1.0
|
|
|
|
# 数据库
|
|
sqlalchemy==2.0.23
|
|
asyncpg==0.29.0
|
|
aiosqlite==0.19.0
|
|
alembic==1.13.1
|
|
|
|
# Redis
|
|
redis==5.0.1
|
|
aioredis==2.0.1
|
|
|
|
# NATS消息队列
|
|
nats-py==2.6.0
|
|
|
|
# HTTP客户端
|
|
httpx==0.25.2
|
|
aiohttp==3.9.1
|
|
|
|
# MCP协议
|
|
# mcp==1.0.0 # 暂时移除,有版本冲突
|
|
json-rpc==1.15.0
|
|
|
|
# 工具和实用程序
|
|
python-multipart==0.0.6
|
|
python-jose[cryptography]==3.3.0
|
|
passlib[bcrypt]==1.7.4
|
|
bcrypt==4.1.2
|
|
|
|
# 监控和日志
|
|
prometheus-client==0.19.0
|
|
structlog==23.2.0
|
|
rich==13.7.0
|
|
psutil==5.9.6
|
|
|
|
# 配置管理
|
|
python-dotenv==1.0.0
|
|
pyyaml==5.3.1
|
|
|
|
# 类型检查和验证
|
|
typing-extensions==4.8.0
|
|
annotated-types==0.6.0
|
|
|
|
# Agent相关
|
|
langchain==0.0.350
|
|
langchain-community==0.0.5
|
|
openai==1.3.8
|
|
anthropic==0.7.8
|
|
|
|
# API文档处理
|
|
openapi-parser==0.2.6
|
|
apispec==6.3.0
|
|
apispec-webframeworks==0.5.2
|
|
|
|
# 开发工具
|
|
pytest==7.4.3
|
|
pytest-asyncio==0.21.1
|
|
black==23.11.0
|
|
flake8==6.1.0
|
|
mypy==1.7.1
|