Skip to content

Commit

Permalink
Add sentry environment (#330)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise authored May 6, 2024
1 parent f4a9013 commit 4dd5c2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/commands/start_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def setup_sentry():
# pylint: disable-next=import-outside-toplevel
import sentry_sdk

sentry_sdk.init(settings.sentry_dsn, traces_sample_rate=0.1)
sentry_sdk.init(
settings.sentry_dsn,
traces_sample_rate=0.1,
environment=settings.sentry_environment or settings.network,
)
sentry_sdk.set_tag('network', settings.network)
sentry_sdk.set_tag('vault', settings.vault)
2 changes: 2 additions & 0 deletions src/config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class Settings(metaclass=Singleton):
genesis_validators_ipfs_retry_timeout: int
validators_fetch_chunk_size: int
sentry_dsn: str
sentry_environment: str
pool_size: int | None

api_host: str
Expand Down Expand Up @@ -173,6 +174,7 @@ def set(
self.web3_log_level = decouple_config('WEB3_LOG_LEVEL', default='INFO')

self.sentry_dsn = decouple_config('SENTRY_DSN', default='')
self.sentry_environment = decouple_config('SENTRY_ENVIRONMENT', default='')

self.ipfs_fetch_endpoints = decouple_config(
'IPFS_FETCH_ENDPOINTS',
Expand Down

0 comments on commit 4dd5c2d

Please sign in to comment.