Skip to content

Commit

Permalink
Add Sentry integration
Browse files Browse the repository at this point in the history
  • Loading branch information
burner1024 committed Aug 5, 2024
1 parent 55613b2 commit 8be3462
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ TFA_PASSWORD=gmail_pass

# Example, note double $ for escaping
# SAVE_MEDIA_TO='/records/$${Y}/$${m}/$${F}T$${t}_$${N}_$${SN}'

# Monitor errors
# SENTRY_DSN=https://XXX.sentry.io/YYY
19 changes: 19 additions & 0 deletions arlo-downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,25 @@

from config import Config

# Optionally, enable Sentry. Should be initialized as early as possible.
SENTRY_DSN = os.getenv("SENTRY_DSN", "_invalid")
if SENTRY_DSN != "_invalid":
import sentry_sdk

sentry_sdk.init(
dsn=SENTRY_DSN,
# Set traces_sample_rate to 1.0 to capture 100%
# of transactions for performance monitoring.
traces_sample_rate=1.0,
# Set profiles_sample_rate to 1.0 to profile 100%
# of sampled transactions.
# We recommend adjusting this value in production.
profiles_sample_rate=1.0,
)
print("Sentry enabled.")
else:
print("Sentry disabled.")


def parse_arguments():

Expand Down
1 change: 1 addition & 0 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@ services:
DEBUG: ${DEBUG:-0}
UID: ${UID:-999}
GID: ${GID:-999}
SENTRY_DSN: ${SENTRY_DSN:-_invalid}
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
cloudscraper>=1.2.71
# TODO: switch to release when better errors is merged
pyaarlo @ git+https://github.com/twrecked/pyaarlo@bb84163fc576c3756bf3a535b8cfe5a436bee8a1

# optional
sentry-sdk>=2.12.0

0 comments on commit 8be3462

Please sign in to comment.