From 637edd21c7bcdbeeeca0766217f50829b3563192 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Tue, 14 Jan 2025 09:49:10 -0500 Subject: [PATCH] Add scope to sentry client --- eve/clients/telegram/client.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eve/clients/telegram/client.py b/eve/clients/telegram/client.py index b7a48b0..de141a2 100644 --- a/eve/clients/telegram/client.py +++ b/eve/clients/telegram/client.py @@ -4,6 +4,7 @@ from ably import AblyRealtime import aiohttp from dotenv import load_dotenv +import sentry_sdk from telegram import Update from telegram.constants import ChatAction from telegram.ext import ( @@ -350,6 +351,10 @@ def start(env: str, local: bool = False) -> None: agent_name = os.getenv("EDEN_AGENT_USERNAME") agent = Agent.load(agent_name) + with sentry_sdk.configure_scope() as scope: + scope.set_tag("client_platform", "telegram") + scope.set_tag("client_agent", agent_name) + bot_token = os.getenv("CLIENT_TELEGRAM_TOKEN") if not bot_token: raise ValueError("CLIENT_TELEGRAM_TOKEN not found in environment variables")