Skip to content

Conversation

MeredithAnya
Copy link
Member

@MeredithAnya MeredithAnya commented Jul 8, 2025

Cleans up how we record clickhouse errors in Sentry - we still will get the clickhouse stack trace, but we don't need to dump the whole stack trace in the error message itself

Before

Screenshot 2025-07-17 at 4 16 42 PM

After

Screenshot 2025-07-17 at 4 15 01 PM

Copy link

sentry-io bot commented Jul 8, 2025

🔍 Existing Issues For Review

Your pull request is modifying functions with the following pre-existing issues:

📄 File: snuba/web/db_query.py

Function Unhandled Issue
_raw_query QueryException: OOM command not allowed under OOM prevention. create...
Event Count: 3

Did you find this useful? React with a 👍 or 👎

@@ -503,9 +502,6 @@ def _raw_query(
elif isinstance(cause, ExecutionTimeoutError):
status = QueryStatus.TIMEOUT

if request_status.slo == SLO.AGAINST:
Copy link
Member Author

Choose a reason for hiding this comment

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

We raise a QueryException later and I think we just end up double reporting to Sentry - if there is a reason to keep this line lemme know

@MeredithAnya MeredithAnya force-pushed the meredith/ch-errors-7-8 branch from 8d01662 to 45f418b Compare July 17, 2025 23:20
@MeredithAnya MeredithAnya marked this pull request as ready for review July 17, 2025 23:23
@MeredithAnya MeredithAnya requested a review from a team as a code owner July 17, 2025 23:23
@phacops
Copy link
Contributor

phacops commented Jul 18, 2025

That's good to remove the stack trace from the message itself.

Maybe we can still attach it to the error using https://develop.sentry.dev/sdk/data-model/event-payloads/exception/ ?

Also, I would separate the error code into an attribute and not as part of the message itself.

@untitaker
Copy link
Member

untitaker commented Jul 18, 2025

a long time ago i wrote this sdk integration to parse clickhouse stacktraces and stitch them as stackframes into the event: https://docs.sentry.io/platforms/python/integrations/gnu_backtrace/

it's activated here:

GnuBacktraceIntegration(),

It worked for a while but I don't know if it works now.

@MeredithAnya
Copy link
Member Author

@untitaker @phacops okie so i spent some time updating the sentry-python sdk - I think getsentry/sentry-python#4598 should work

That being said, I still think the changes in this PR are reasonable since we don't need the clickhouse stack trace reported multiple times

@MeredithAnya MeredithAnya merged commit db7ba70 into master Jul 21, 2025
35 checks passed
@MeredithAnya MeredithAnya deleted the meredith/ch-errors-7-8 branch July 21, 2025 17:34
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