Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion scripts/init_serverless_sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,24 @@

import sentry_sdk
from sentry_sdk._types import MYPY
from sentry_sdk.utils import Dsn
from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration

if MYPY:
from typing import Any


def extension_relay_dsn(original_dsn):
dsn = Dsn(original_dsn)
dsn.host = "localhost"
dsn.port = 3000
dsn.scheme = "http"
return str(dsn)
Comment on lines +21 to +26

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 💯



# Configure Sentry SDK
sentry_sdk.init(
dsn=os.environ["SENTRY_DSN"],
dsn=extension_relay_dsn(os.environ["SENTRY_DSN"]),
integrations=[AwsLambdaIntegration(timeout_warning=True)],
traces_sample_rate=float(os.environ["SENTRY_TRACES_SAMPLE_RATE"]),
)
Expand Down