Fix data exfil even with disabled Sentry logging - #319
Open
symbioquine wants to merge 1 commit into
Open
Conversation
Motivation: The `sentry_sdk` package implements pretty aggressive instrumentation that hooks itself into various parts of the Python runtime which can result in data sent to Sentry that the user may not intend to share. See openclimatefix/open-source-quartz-solar-forecast/317 Ideally, the Sentry logging would be fixed to only do the explicit logging that the original commit intended, but for now this change just fixes the handling of the `QUARTZ_SOLAR_FORECAST_LOGGING` environment variable to at least fully disable the `sentry_sdk` integration.
peterdudfield
approved these changes
Oct 17, 2025
peterdudfield
left a comment
Contributor
There was a problem hiding this comment.
Thanks this looks great
Contributor
|
you happy for this to get merged? |
Author
Yeah, sounds good. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Description
Motivation: The
sentry_sdkpackage implements pretty aggressive instrumentation that hooks itself into various parts of the Python runtime which can result in data sent to Sentry that the user may not intend to share.Ideally, the Sentry logging would be fixed to only do the explicit logging that the original commit intended, but for now this change just fixes the handling of the
QUARTZ_SOLAR_FORECAST_LOGGINGenvironment variable to at least fully disable thesentry_sdkintegration.Fixes #317
How Has This Been Tested?
Ran
uv add --editable /path/to/repositories/git/open-source-quartz-solar-forecastfrom another package and tested my own app with these changes.Also ran
docker compose up -dand did some minimal smoke testing based on the example provided in theapi/README.mdfile:If your changes affect data processing, have you plotted any changes? i.e. have you done a quick sanity check?
YesN/AChecklist:
I have made corresponding changes to the documentationN/AI have added tests that prove my fix is effective or that my feature worksN/A (I'm not convinced it's worthwhile to try and prove that the Sentry SDK is not imported/initialized in an automated test - though I'm happy to hear ideas about how such a test would work.)