feat: add Confluence recent pages + Sentry error tracking (MAT-58, MAT-59)
MAT-58: Add recent_confluence_pages tool to both voice and text chat. Shows last 5 recently modified pages so users can pick directly instead of having to search every time. MAT-59: Integrate sentry-sdk in all three entry points (agent.py, bot.py, voice.py). SENTRY_DSN env var, traces at 10% sample rate. Requires creating project in Sentry UI and setting DSN. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
8
agent.py
8
agent.py
@@ -3,6 +3,8 @@ import json
|
||||
import base64
|
||||
import logging
|
||||
|
||||
import sentry_sdk
|
||||
|
||||
from livekit.agents import Agent, AgentSession, AgentServer, JobContext, JobProcess, cli
|
||||
from livekit.plugins import openai as lk_openai, elevenlabs, silero
|
||||
import livekit.rtc as rtc
|
||||
@@ -12,6 +14,12 @@ from e2ee_patch import KDF_HKDF
|
||||
logger = logging.getLogger("matrix-ai-agent")
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
# Sentry error tracking
|
||||
_sentry_dsn = os.environ.get("SENTRY_DSN", "")
|
||||
if _sentry_dsn:
|
||||
sentry_sdk.init(dsn=_sentry_dsn, traces_sample_rate=0.1, environment=os.environ.get("SENTRY_ENV", "production"))
|
||||
logger.info("Sentry initialized for agent")
|
||||
|
||||
LITELLM_URL = os.environ["LITELLM_BASE_URL"]
|
||||
LITELLM_KEY = os.environ.get("LITELLM_API_KEY", "not-needed")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user