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

feat: sentry fastapi integration added #46

Merged
merged 1 commit into from
Jan 12, 2024

Conversation

sambarnes
Copy link
Collaborator

@sambarnes sambarnes commented Jan 12, 2024

Details

todays warmup ☕ we had sentry on the completion container startup, but nowhere else in the runner

now, any exception that causes an Internal Error will report up to sentry (behavior can be found in the docs here) and all new endpoints are auto instrumented with it

e.g. i deployed this endpoint to dev & it bubbled up to sentry here

@api_app.get("/foo")
async def foo():
    return 5 / 0

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I agree to license this contribution under the MIT LICENSE
  • I checked the current PR for duplication.

Comment on lines +75 to +77
image=Image.debian_slim(python_version="3.10").pip_install(
"sentry-sdk[fastapi]==1.39.1"
),
Copy link
Collaborator Author

@sambarnes sambarnes Jan 12, 2024

Choose a reason for hiding this comment

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

ngl not a fan of having to put these deps in .pip_install blocks everywhere & duplicating what a pyproject.toml should do :/ a little hard to reason about what packages are allowed to be imported & in what scopes (but seems like just a modal limitation)

i think when @montasaurus adds the ddtrace package, it might make sense to consolidate some of this dependency boilerplate with a func that takes in a modal.Image and chains in the .pip_install( for sentry+ddtrace+other common observability things

at least keep it in a single spot in our python

Copy link
Contributor

Choose a reason for hiding this comment

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

Got exactly that in a PR I'm working on!

@sambarnes sambarnes marked this pull request as ready for review January 12, 2024 15:47
@montasaurus montasaurus merged commit 8f98b6b into OpenRouterTeam:main Jan 12, 2024
3 checks passed
@sambarnes sambarnes deleted the sentry-fastapi branch January 12, 2024 16:08
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