Skip to content
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

Pass SENTRY_ENVIRONMENT through to frontend #8799

Merged
merged 1 commit into from
Jul 8, 2024
Merged

Conversation

robertknight
Copy link
Member

Propagate the Sentry environment name through to the frontend code that initializes the Sentry JS SDK.

Propagate the Sentry environment name through to the frontend code that
initializes the Sentry JS SDK.
@@ -27,6 +27,7 @@ def add_renderer_globals(event):
if "h.sentry_dsn_frontend" in request.registry.settings:
event["frontend_settings"]["sentry"] = {
"dsn": request.registry.settings["h.sentry_dsn_frontend"],
"environment": request.registry.settings["h.sentry_environment"],
Copy link
Member Author

Choose a reason for hiding this comment

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

h.sentry_environment is currently always set. It takes its value from the SENTRY_ENVIRONMENT env var with a default of dev.

Copy link
Member

Choose a reason for hiding this comment

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

We have (in h-prod):

SENTRY_ENVIRONMENT

and

ENV

both with value a value of prod 👍

We might want to look at combine those at some point, outside of scope here.

@robertknight
Copy link
Member Author

Alejandro is away this week, so I'm tagging BE folks for review.

Copy link
Member

@marcospri marcospri left a comment

Choose a reason for hiding this comment

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

Looks good 👍

@@ -27,6 +27,7 @@ def add_renderer_globals(event):
if "h.sentry_dsn_frontend" in request.registry.settings:
event["frontend_settings"]["sentry"] = {
"dsn": request.registry.settings["h.sentry_dsn_frontend"],
"environment": request.registry.settings["h.sentry_environment"],
Copy link
Member

Choose a reason for hiding this comment

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

We have (in h-prod):

SENTRY_ENVIRONMENT

and

ENV

both with value a value of prod 👍

We might want to look at combine those at some point, outside of scope here.

@robertknight robertknight merged commit d7110c5 into main Jul 8, 2024
9 checks passed
@robertknight robertknight deleted the sentry-frontend-env branch July 8, 2024 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants