Skip to content
This repository was archived by the owner on Jun 28, 2024. It is now read-only.

Commit 992c6fa

Browse files
committed
Add get_sentry_dsn()
1 parent 08452af commit 992c6fa

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

seamapi/seam.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import os
2+
3+
from seamapi.utils.get_sentry_dsn import get_sentry_dsn
24
from .routes import Routes
35
import requests
46
import sentry_sdk
@@ -72,7 +74,7 @@ def __init__(
7274

7375
if self.should_report_exceptions:
7476
sentry_sdk.init(
75-
dsn=os.environ.get("SENTRY_DSN", None),
77+
dsn=get_sentry_dsn(),
7678
default_integrations=False,
7779
)
7880
sentry_sdk.set_context("sdk_info", {

seamapi/utils/get_sentry_dsn.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import os
2+
3+
def get_sentry_dsn():
4+
# This is replaced with a hard-coded value during the build process (see scripts/prebuild.py)
5+
return os.environ.get("SENTRY_DSN", None)

0 commit comments

Comments
 (0)