4 ms·
A problem I have with Python tracing is Django-specific: often my trace is a ton of Django internal code and doesn’t even point to my code that’s causing the pr
by Waterluvian 4y ago
A problem I have with Python tracing is Django-specific: often my trace is a ton of Django internal code and doesn’t even point to my code that’s causing the problem.
Not sure if there’s a way to address this kind of issue. Or if it’s common elsewhere? Just this experience of “what I wrote is being run in the context of some library internals and so it spits out the internals.”
- scrollaway 4y agoIf you’re using django, try Sentry. It’s good at sorting out the noise from the signal, including separating parts of traces that aren’t relevant to your app.
- fancy_pantser 4y agoThe common solution is filtering. Almost all tracers will accept predicates to exclude Django per your example.
- Waterluvian 4y agoMy issue is that the trace sometimes does not include any lines pertaining to my code. I’m really not sure how that can be true. I’ll have to save an example next time for the next time I bring this up.
- antiatheist 4y agoI get similar errors with FastAPI, I believe it's due to compiled routes/code being run separately in the web server etc, it's really up to the Django and FastAPI devs to implement proper traces here.
- drcongo 4y agoI'm with you. I've had huge stack traces from Django, many many times, without even a hint of my own code in them. I've always assumed it's the extremely "extended" nature of Django - my class extends A which extends B and C, and C extends D, E and F and F uses a G metaclass and so on.