Skip to content

Commit

Permalink
Add Sentry integration (#94)
Browse files Browse the repository at this point in the history
Signed-off-by: cyc60 <[email protected]>
  • Loading branch information
cyc60 authored Jun 6, 2022
1 parent 8176e31 commit d618fea
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 1 deletion.
7 changes: 7 additions & 0 deletions oracle/keeper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
HEALTH_SERVER_PORT,
KEEPER_PROCESS_INTERVAL,
LOG_LEVEL,
SENTRY_SDK,
)
from oracle.utils import InterruptHandler

Expand Down Expand Up @@ -63,4 +64,10 @@ def main() -> None:
f"Starting monitoring server at http://{HEALTH_SERVER_HOST}:{HEALTH_SERVER_PORT}"
)
t.start()

if SENTRY_SDK:
import sentry_sdk

sentry_sdk.init(SENTRY_SDK, traces_sample_rate=0.3)

main()
6 changes: 6 additions & 0 deletions oracle/oracle/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
HEALTH_SERVER_PORT,
LOG_LEVEL,
ORACLE_PROCESS_INTERVAL,
SENTRY_SDK,
TEST_VOTE_FILENAME,
)
from oracle.utils import InterruptHandler, get_oracle_accounts
Expand Down Expand Up @@ -173,4 +174,9 @@ async def process_network(
f"Starting monitoring server at http://{HEALTH_SERVER_HOST}:{HEALTH_SERVER_PORT}"
)
t.start()
if SENTRY_SDK:
import sentry_sdk

sentry_sdk.init(SENTRY_SDK, traces_sample_rate=0.3)

asyncio.run(main())
36 changes: 35 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ gql = {version = "3.2.0", extras = ["aiohttp"]}
backoff = "==2.0.1"
aiohttp = {version = "==3.8.1", extras = ["speedups"]}
boto3 = {version = "==1.22.1", extras = ["awscrt"]}
sentry-sdk = {version = "==1.5.12", optional = true}

[tool.poetry.dev-dependencies]
mypy = "==0.950"
Expand Down

0 comments on commit d618fea

Please sign in to comment.