feat(observability): implement global database error logging, Prometheus error metrics, and max 3-panel Grafana dashboard
This commit is contained in:
@@ -5,6 +5,7 @@ from db.models import Post, TargetChannel
|
||||
from db.repository import Repository
|
||||
from core.llm import LLMClient
|
||||
from core.metrics import DUPLICATES_DETECTED_TOTAL
|
||||
from core.error_logger import log_exception
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -57,7 +58,7 @@ class AIProcessor:
|
||||
if rewritten:
|
||||
return rewritten.strip()
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to rewrite post for target {target.id} ({target.title}): {e}")
|
||||
await log_exception("ai_processor.rewrite", e, {"target_id": target.id, "target_title": target.title})
|
||||
|
||||
# Fallback if AI fails: clean basic @mentions and append footer
|
||||
fallback = raw_text
|
||||
|
||||
Reference in New Issue
Block a user