We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3587b7a commit 6e2d8c7Copy full SHA for 6e2d8c7
scripts/init_serverless_sdk.py
@@ -11,15 +11,24 @@
11
12
import sentry_sdk
13
from sentry_sdk._types import MYPY
14
+from sentry_sdk.utils import Dsn
15
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
16
17
if MYPY:
18
from typing import Any
19
20
21
+def extension_relay_dsn(original_dsn):
22
+ dsn = Dsn(original_dsn)
23
+ dsn.host = "localhost"
24
+ dsn.port = 3000
25
+ dsn.scheme = "http"
26
+ return str(dsn)
27
+
28
29
# Configure Sentry SDK
30
sentry_sdk.init(
- dsn=os.environ["SENTRY_DSN"],
31
+ dsn=extension_relay_dsn(os.environ["SENTRY_DSN"]),
32
integrations=[AwsLambdaIntegration(timeout_warning=True)],
33
traces_sample_rate=float(os.environ["SENTRY_TRACES_SAMPLE_RATE"]),
34
)
0 commit comments