Skip to content

Commit

Permalink
Add scope to sentry client
Browse files Browse the repository at this point in the history
  • Loading branch information
jmilldotdev committed Jan 14, 2025
1 parent 25961c9 commit 637edd2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eve/clients/telegram/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 637edd2

Please sign in to comment.