Skip to content

fix: Disable sentry based on if in local development or not - #625

Merged
BigSpaceships merged 3 commits into
ComputerScienceHouse:developfrom
NickJ-7010:develop
Oct 2, 2026
Merged

BigSpaceships merged 3 commits into
ComputerScienceHouse:developfrom
NickJ-7010:develop

Conversation

@NickJ-7010

Copy link
Copy Markdown
Contributor

What

what the PR changes

Disables sentry if the environment variable CONDITIONAL_SENTRY_ENV is exactly "local-development" (default value).

Why

why these changes were made

Because I accidentally flooded #monitoring with sentry errors from my local environment so it was decided to have it disabled as the default.

Test Plan

how did you verify these changes did what you expected

I tried to test all the possible ways the env variable could be set and in the different contexts... but I only had like a 10% success rate when trying to display a new env variable after updating it 💀. So please test with whatever conditions you think will be encountered as I could have failed miserably and not known it.

Env Vars

did you add, remove, or rename any environment variables

No

Documentation

did you add or update any documentation. PRs should, at the minimum, update documentation when they make existing documentation out of date.

No

Checklist

  • Tested all changes locally

@datadog-computersciencehouse

datadog-computersciencehouse Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has warnings. Please review the issues below.

🚦 1 Pipeline job failed

Sonarqube | Sonarqube Analysis

View in Datadog · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: e24ad7c | Docs | View more details | Give us feedback!

@costowell costowell left a comment

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.

IMO just check if it's unset/the empty string to disable sentry. The "local-development" special value is redundant if the empty string also achieves the same behavior.

Comment thread README.md

### Using Sentry
If you want to opt-into logging errors through Sentry then set the `CONDITIONAL_SENTRY_ENV` environment variable to anything other than `local-development`.
Setting it to `local-development` or having the environment variable unset disables Sentry in both the frontend and backend (Re-building the container may be required).

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.

"Or having the environment variable unset"
Is this true?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

setting it to local-development disables sentry, if you don't set the variable it will default to local-development (it already defaulted to that). Is my phrasing confusing?

@BigSpaceships BigSpaceships left a comment

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.

shippitttt

@BigSpaceships
BigSpaceships merged commit 18ea5d3 into ComputerScienceHouse:develop Oct 2, 2026
2 of 3 checks passed
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.

3 participants