Skip to content

Commit 6e2d8c7

Browse files
authored
feat(extension): Replace original DSN host/port with localhost:3000 (#1414)
1 parent 3587b7a commit 6e2d8c7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/init_serverless_sdk.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,24 @@
1111

1212
import sentry_sdk
1313
from sentry_sdk._types import MYPY
14+
from sentry_sdk.utils import Dsn
1415
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration
1516

1617
if MYPY:
1718
from typing import Any
1819

1920

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+
2029
# Configure Sentry SDK
2130
sentry_sdk.init(
22-
dsn=os.environ["SENTRY_DSN"],
31+
dsn=extension_relay_dsn(os.environ["SENTRY_DSN"]),
2332
integrations=[AwsLambdaIntegration(timeout_warning=True)],
2433
traces_sample_rate=float(os.environ["SENTRY_TRACES_SAMPLE_RATE"]),
2534
)

0 commit comments

Comments
 (0)