Replace deprecated raven client with sentry-sdk in SentryReporter

Open
#32 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start with backlash/tracing/reporters/sentry.py and review SentryReporter and RavenNotAvailable, then inspect backlash/frtools.py for the backlash_event flag. Check the deprecated re-export in backlash/trace_errors/sentry.py and the Sentry section of README.rst. Done means crash and slow-request reports use sentry-sdk, the raven import is gone, the flag distinction remains, and the optional dependency is documented.

Written by the indexing model from the issue text.

Description

Goal

Port SentryReporter from the retired raven client to the current
sentry-sdk.

Done when: crash reports and slow-request stack dumps reach Sentry through
sentry-sdk, the raven import is gone, and the optional dependency is
documented for users who want Sentry reporting.

Points that need attention during the port:

  • raven.base.Client(sentry_dsn) has no direct equivalent; sentry_sdk uses
    sentry_sdk.init(dsn=...) plus a Client/Scope model.
  • client.captureException(exc_info=..., data=...) and
    client.captureMessage(..., stack=...) map to capture_exception /
    capture_event with a different payload shape.
  • The sentry.interfaces.Http dict is assembled by hand from
    raven.utils.wsgi helpers (get_current_url, get_headers, get_environ),
    which do not exist in sentry-sdk; the WSGI request data has to be built
    another way.
  • The backlash-specific backlash_event flag distinguishes a slow-request
    stack dump from a real crash, and that distinction should survive the port.

Why

raven was last released in December 2018, is officially retired in favour of
sentry-sdk, and advertises support only up to Python 3.6. backlash now
supports Python 3.9 through 3.14, so the Sentry reporting feature is
effectively unavailable to current users: nobody can reasonably install the
client it requires.

The import is optional and wrapped in try/except ImportError, so the failure
is silent - SentryReporter simply raises RavenNotAvailable at construction
time. Documented functionality therefore looks supported while being
unreachable in practice.

References

  • backlash/tracing/reporters/sentry.py (SentryReporter, RavenNotAvailable)
  • backlash/trace_errors/sentry.py is the deprecated shim re-exporting it
  • README.rst (Sentry reporting section)
  • backlash/frtools.py (DumpThread) is the source of the backlash_event flag
  • sentry-sdk migration guide (raven -> sentry-sdk)
Dominant language
Python
Stars
13
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TurboGears/backlash

All issues in TurboGears/backlash

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.