Skip to content

feat(extension): Replace original DSN host/port with localhost:3000 #1414

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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
Member

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