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.
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
Changes from all commits
f2b6065
e30dd50
e2c5218
56080db
acbc137
2d0fe27
d241965
76e0324
f5d1f96
59f94af
91e5910
4bcd722
c3190dd
390852c
a9f06ba
a191fe0
c422483
29d992d
c4910d9
b2a918a
b9d66a0
b328575
baf8221
182f2ec
80ec976
c93a2fa
3de4055
bc271be
d33785d
ce167b5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
Large diffs are not rendered by default.
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
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.
Yeah Bond does it too
https://github.com/DataBiosphere/bond/blob/e53378b1563ef2275ff66b9e924c0a3f776ac711/main.py#L21
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.
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:
everywhereThere 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 envSome generated files are not rendered by default. Learn more about how customized files appear on GitHub.