-
Notifications
You must be signed in to change notification settings - Fork 2
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
FE-147 add sentry for production readiness interim dagster #326
FE-147 add sentry for production readiness interim dagster #326
Conversation
…ions with better conditional logic (see FE-128)
…Biosphere/hca-ingest into FE-128-dedup-github-actions
…sue. Testing is not needed in dev as we run this on all PR pushes & syncs. Testing can/should be run locally in dev (takes 90 minutes)
…Biosphere/hca-ingest into FE-128-dedup-github-actions
…to FE-147-add-sentry-for-production-readiness-interim-dagster
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #326 +/- ##
=======================================
Coverage 95.56% 95.56%
=======================================
Files 4 4
Lines 158 158
Branches 5 5
=======================================
Hits 151 151
Misses 7 7 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had a question about the SDK init. Can you fix up the description a bit too? It seems to be mis-formatted.
@@ -9,7 +9,8 @@ ENV PYTHONFAULTHANDLER=1 \ | |||
PIP_NO_CACHE_DIR=off \ | |||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | |||
PIP_DEFAULT_TIMEOUT=100 \ | |||
POETRY_VERSION=1.1.8 | |||
POETRY_VERSION=1.1.8 \ | |||
SENTRY_DSN=https://[email protected]/4506559533088768 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean the pipeline is using the same DSN for dev and prod? Will that intermix errors between the two environments or is there a way to distinguish between the two the sentry setup?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes - Sam has a setup for this whereby each env gets a DSN which I like, but seemed like overkill for a throwaway. Plus, the only time dev runs is when I am testing the pipeline and hopefully don't have to do that again?
And - I'm still unsure of the utility here as it's all just duplicating the dagit errors which are also caught in the cloud console logs explorer.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not thrilled with the idea of intermixing the environments but given the time constraints and desire to replatform probably not worth revisiting at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW - if it becomes an issue in this interim, I will address it and definitely will not intermix in the re-platform
"", | ||
) | ||
if SENTRY_DSN: | ||
sentry_sdk.init(dsn=SENTRY_DSN, traces_sample_rate=1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs state that the sdk will attempt to pull from the environment automatically and if it can't find the DSN it will just not send events. Given that, what do you think about simplifying this logic to a sentry_sdk.init(traces_sample_rate=1.0)
and letting the SDK sort out the env var resolution?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That makes sense to me - I just copied this in from what Zebrafish & SCP did. - I don't have strong feelings either way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At this point... I'm inclined to leave it alone unless I need to touch this again. I'd have to rebuild, deploy to dev, test, then PR to main, which triggers the E2E tests, and then go through review and deploy to prod, then smoke test. That functionally takes me to the end of the week.
What do you think about the compromise of making a ticket for this (it's what I did with cleaning up the git actions)? I'll pick this back up if I have to update the codebase again?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, ticket makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
"", | ||
) | ||
if SENTRY_DSN: | ||
sentry_sdk.init(dsn=SENTRY_DSN, traces_sample_rate=1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, ticket makes sense.
@@ -9,7 +9,8 @@ ENV PYTHONFAULTHANDLER=1 \ | |||
PIP_NO_CACHE_DIR=off \ | |||
PIP_DISABLE_PIP_VERSION_CHECK=on \ | |||
PIP_DEFAULT_TIMEOUT=100 \ | |||
POETRY_VERSION=1.1.8 | |||
POETRY_VERSION=1.1.8 \ | |||
SENTRY_DSN=https://[email protected]/4506559533088768 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not thrilled with the idea of intermixing the environments but given the time constraints and desire to replatform probably not worth revisiting at this point.
"", | ||
) | ||
if SENTRY_DSN: | ||
sentry_sdk.init(dsn=SENTRY_DSN, traces_sample_rate=1.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you know or can you test that if you had a file say sentry_entrypoint.py and in that if you defined the
SENTRY_DSN = os.getenv( "SENTRY_DSN", "", ) if SENTRY_DSN: sentry_sdk.init(dsn=SENTRY_DSN, traces_sample_rate=1.0)
and that if in each of the files where you want sentry to monitor then you wrote
**from sentry_entrypoint import *** if that would work too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bahill I was trying to find a way of not repeating if SENTRY_DSN:
everywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
100% with you on that. I weighed it out - doing something like SCP does, but it only saved me like 4 lines of code, and I'm not changing this again, so I went with the brute force duct tape approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also - re: Drew's point from above - it's basically the same number of lines and actually fewer files if I were to leave out the if SENTRY_DSN
bit and let Sentry just figure out its DSN from the env
@bahill can we setup SENTRY_DSN as an env var in another PR? |
Why
Relevant ticket FE-147
This PR
Checklist