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

Enhancement: Add Sentry integration for 2.0 #1514

Open
JacobCoffee opened this issue Apr 17, 2023 · 13 comments
Open

Enhancement: Add Sentry integration for 2.0 #1514

JacobCoffee opened this issue Apr 17, 2023 · 13 comments
Labels
Enhancement This is a new feature or request Good First Issue This is good for newcomers to take on Help Wanted 🆘 This is good for people to work on Plugin This is related to our plugin architecture

Comments

@JacobCoffee
Copy link
Member

JacobCoffee commented Apr 17, 2023

Summary

We have a sentry integration for 1.x. We need to update that integration, but we did not write any docs.

Basic Example

Please follow the Sentry Integration Guide with special emphasis on the docs

Per the Sentry Integration Guide:

Write the docs. Answer the following questions:

  • What does your integration do? Split in two sections: Executive summary at top and exact behavior further down.
  • Which version of the SDK supports which versions of the modules it hooks into?
  • One code example with basic setup.
  • Make sure to add integration page to python/index.md (people forget to do that all the time).

Drawbacks and Impact

N/A

Unresolved questions

  1. How do we handle the renaming of the current integration per Sentry guidelines?
Fund with Polar
@JacobCoffee JacobCoffee added Enhancement This is a new feature or request Help Wanted 🆘 This is good for people to work on Good First Issue This is good for newcomers to take on labels Apr 17, 2023
@JacobCoffee JacobCoffee added this to the 2.0 milestone Apr 17, 2023
@Goldziher
Copy link
Contributor

I dont think this is an issue for this repository. Sentry is a for-profit company, and we should not contribute to them out of our own charity. Please open an issue on the sentry side of the fence, and they can take it from there - or not.

@janluke
Copy link

janluke commented Oct 16, 2023

@provinzkraut Does the current integration for Starlite need major modifications or it's just a matter of renaming starlite with litestar?

@janluke
Copy link

janluke commented Oct 19, 2023

I asked the question because we need this (at the company I work for) and we're considering contributing, I just wanted to have an idea on the effort needed, considering that we're new to Litestar and never contributed to Sentry. Thanks.

@peterschutt
Copy link
Contributor

I'm a heavy user of sentry also, so would like to see this done. I'd have to look at the code more thoroughly to comment, but I'd imagine there will be some fairly significant changes required as starlite -> litestar was a bit of a jump.

@peterschutt peterschutt reopened this Oct 19, 2023
@JacobCoffee
Copy link
Member Author

It would be welcome and we could help with the transition when needed.

@bpereto
Copy link

bpereto commented Oct 23, 2023

I tried to adapt the implementation mentioned in https://github.com/getsentry/sentry-python/blob/f570a9966252920bdb221101d596eb029497b0e9/sentry_sdk/integrations/starlite.py#L51

https://gist.github.com/bpereto/8b49893f4a19740c19bf336af94aa95b#file-sentry-py

I can tell that the errors do show up :)
but I struggled with the retrieve_user_from_scope.

@JacobCoffee JacobCoffee added the Plugin This is related to our plugin architecture label Dec 7, 2023
@kedod
Copy link
Contributor

kedod commented Mar 9, 2024

@bpereto Do you need a hand with this one?

@JacobCoffee
Copy link
Member Author

JacobCoffee commented Mar 9, 2024

@kedod you might work with @guacs as well. There is a thread in the development discord channel.

Happy to have anyone help or maybe even just take this if they have the capacity!

@bpereto
Copy link

bpereto commented Mar 9, 2024

@bpereto Do you need a hand with this one?

I'm not sure how the internals of litestar work, but my implementation attempt seems do it's job.

maybe you know the framework better and how to implement it correctly?

Im unsure if the references are the newest versions.

@guacs
Copy link
Member

guacs commented Mar 10, 2024

@kedod if you want to take this, please feel free :)

@JacobCoffee JacobCoffee modified the milestones: 2.0, Future release Mar 10, 2024
@rafalkrupinski
Copy link

I was expecting adding SentryAsgiMiddleware to the list of middlewares to have at least some effect, but no.

@peterschutt
Copy link
Contributor

The logging integration gives you something, but obviously not ideal as no spans etc.

I spoke with one of their engineers at pycon, and he mentioned they might be exposing some new apis that would help us to build an integration without monkey-patching the application (which would be my preference). I'll be watching that space, but as a sentry user myself, this is a problem I'd like to see solved too.

@rafalkrupinski
Copy link

OK, looks like I forgot to configure DSN :D
ASGI integration actually does something.

If one was to contribute to the integration:

  • did anyone started a sentry fork to put the code in?
  • is there a guide for integrating with python servers or a reference integration?

I like Litestar code, but I know nothing about sentry internals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement This is a new feature or request Good First Issue This is good for newcomers to take on Help Wanted 🆘 This is good for people to work on Plugin This is related to our plugin architecture
Projects
Status: Ideas
Development

No branches or pull requests

8 participants