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

🐛 Sentry alerts showing as environment dev #370

Closed
mitchdawson1982 opened this issue May 23, 2024 · 0 comments
Closed

🐛 Sentry alerts showing as environment dev #370

mitchdawson1982 opened this issue May 23, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@mitchdawson1982
Copy link
Collaborator

mitchdawson1982 commented May 23, 2024

Describe the bug.

NOTE: Labelled as a bug however it appears that conflicting Sentry code within the Datahub Telemetry module could be the root cause

Sentry Issue

We have a Django application running across three environments (test, dev and preprod), each environment has an ENV variable configured with the respective value. This variable is used as the environment argument in the sdk init.

We noticed that events were being received in Sentry with an environment of dev only, i.e. test or preprod were never used despite being configured correctly. When validating this behaviour locally I have also found that periodically alerts will come in with the environment as dev despite an entirely different value being provided. I have further noticed that when this occurs, the release value is also different from a working example.

To Reproduce

visit https://data-platform-find-moj-data-dev.apps.live.cloud-platform.service.justice.gov.uk/sentry-debug/ to generate a divide by zero exception.

Expected Behaviour

Expected Result
When ENV=new-env1 received alerts should show the environment as new-env1

Additional context

It appears that the datahub telemetry code is invoking sentry here which could explain our issues.

Proposed work around

  • Unset SENTRY_DSN environment variable across environments
  • Define a new variable to hold the sentry dsn value i.e. SENTRY_DSN_WORKAROUND
  • Deploy and validate correct Sentry operation across environments
@mitchdawson1982 mitchdawson1982 added the bug Something isn't working label May 23, 2024
@mitchdawson1982 mitchdawson1982 self-assigned this May 23, 2024
@mitchdawson1982 mitchdawson1982 changed the title 🐛 Datahub telemetry library is invoking sentry sdk init 🐛 Sentry alerts showing as environment dev May 23, 2024
@mitchdawson1982 mitchdawson1982 closed this as completed by moving to Done in Data Catalogue May 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

No branches or pull requests

1 participant