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

Allow to set sentry environment via env var SENTRY_ENVIRONMENT #4906

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wozniakpl
Copy link

Checklist

  1. If you've added code that should be tested, add tests
  2. If you've changed APIs, update (or create!) the documentation
  3. Ensure the tests pass
  4. Make sure that your code lints and that you've followed our coding style
  5. Write a title and, if necessary, a description of your work suitable for publishing in our release notes
  6. Mention any related issues in this repository (as #ISSUE) and in other repositories (as kobotoolbox/other#ISSUE)
  7. Open an issue in the docs if there are UI/UX changes

Description

Updated Sentry initialization to dynamically set the environment parameter using an environment variable SENTRY_ENVIRONMENT. This aids in filtering and analyzing errors by deployment stage.

Notes

Added this line to sentry_sdk.init call's params:

environment=env.str('SENTRY_ENVIRONMENT', 'production'),

It's set by default to production for backwards compatibility purposes. This is what's set by default.

@jnm jnm added the Back end label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants