- Initialize Sentry SDK in FastAPI (auto-disabled when DSN empty) - Add sentry_sdk.set_measurement in metrics middleware - Add sentry-sdk[fastapi] to requirements - Refactor rate_limit.py: abstract RateLimitBackend + MemoryBackend + RedisBackend - Redis backend uses sorted set sliding window with pipeline atomicity - Memory backend adds asyncio cleanup task to prevent memory growth - Auto-fallback to memory when Redis unavailable - Add RATE_LIMIT_BACKEND config (default: memory) |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| agent_hooks.py | ||
| llm_metrics.py | ||
| logging_filter.py | ||
| logging_middleware.py | ||
| metrics.py | ||
| prometheus_metrics.py | ||
| rate_limit.py | ||
| request_id.py | ||
| subscription_enforcement.py | ||