Sentry Exception names only show "Traceback" instead of actual exception name
See original GitHub issueI have Sentry set up for a Python application that we’re using internally.
The Sentry exception ticket has the following attributes:
- Name:
Traceback (most recent call last):
- Message:
Traceback (most recent call last):
File "/percolate/analytics/pegasus/pegasus/services/aquarius/service.py", line 28, in Query
resp = builder.build()
File "/percolate/analytics/pegasus/pegasus/services/aquarius/builder.py", line 235, in build
q = self.apply_sort(q)
File "/percolate/analytics/pegasus/pegasus/services/aquarius/builder.py", line 225, in apply_sort
sorts = [s.apply_sort(self.selects) for s in self.sort]
File "/percolate/analytics/pegasus/pegasus/services/aquarius/builder.py", line 225, in <listcomp>
sorts = [s.apply_sort(self.selects) for s in self.sort]
AttributeError: 'NumericField' object has no attribute 'apply_sort'
See the following screen capture:
I see a number of exceptions in the Sentry UI with the same Traceback: ...
name instead of the specific exception name. Is there a reason why this is the case?
Here’s the code that triggers these exceptions:
try:
query_result = q.execution_options(timeout=PEGASUS_QUERY_TIMEOUT).all()
except Exception as e:
if sentry_client:
with sentry_client.configure_scope() as scope:
compiled_query = q.statement.compile(
dialect=postgresql.dialect()
)
scope.set_extra("query", str(compiled_query))
scope.set_extra("params", str(compiled_query.params))
raise e
It’s not clear if I’m using the Sentry client closing context correctly, or if this is an actual issue within the Sentry SDK. Thank you for your help in advance!
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
Sentry not showing exception in web UI with logger.exception()
Sentry will show the exception message and stack trace from the utils logger but the app logger will ONLY log the error message...
Read more >Capturing Errors | Sentry Documentation
Notice the unhandled exception appears in the list of issues. Unhandled Issue. Click on the issue, to open the Issue Details page. Issue...
Read more >Event Type Definitions - Sentry Developer Documentation
This page documents the event schema for errors, just like the other ... DEPRECATED: Prefer threads or exception depending on which is more...
Read more >Reporting Exceptions in Python Scripts with Sentry
That's where adding Sentry can solved this distributed error logging problem. In this tutorial, we'll see how to quickly add Sentry to a...
Read more >SentryOptions class - sentry_io library - Dart API - Pub.dev
Stack traces are always attached to exceptions; however, when this option is set, ... This only applies to Dart:io platforms and only the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
You can change it to
log.error("my code failed", exc_info=True)
and it should work!Jinx, you hit the nail on the head. Thank you again. I’ll close this ticket out.