# Nameko-sentry: can't report to sentry

**URL:** <https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560>\
**Category:** Uncategorized\
**Created:** [March 10, 2020, 6:01pm UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560 "2020-03-10T18:01:03Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksimmi](https://avatars.discourse-cdn.com/v4/letter/k/f4b2a3/32.png) [@ksimmi](https://discourse.nameko.io/u/ksimmi)\
**Post date:** [March 10, 2020, 6:01pm UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/1 "2020-03-10T18:01:03Z")

</div>

Hello!

I tried to send reports to sentry from my nameko-app with nameko-sentry and It wasn’t succesful. I tried Python3.8.1 and Python3.6.9 with the same result. I generated DSN on my [sentry.io](http://sentry.io) account and put it into config.yaml. After this I just copied official example code from nameko-sentry git repository and run it:  
# service.py

```
from nameko.web.handlers import http
from nameko_sentry import SentryReporter
class Service(object):
    name = "demo"

    sentry = SentryReporter()

    @http("GET", "/broken")
    def broken(self, request):
        raise SomeException("boom")

```

I can’t see any result in [sentry.io](http://sentry.io) after raising SomeExcepton(‘boom’) or simple Exception(‘boom’).  
But when I using sentry\_sdk.capture\_exception directly with the same DSN I can see new reports in [sentry.io](http://sentry.io). What I’m doing wrong with nameko-sentry?

---

<div class="post-metadata">

**Author:** ![pony](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/pony/32/100_2.png) [@pony](https://discourse.nameko.io/u/pony)\
**Post date:** [June 3, 2020, 8:26am UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/2 "2020-06-03T08:26:42Z")

</div>

Is your config like this?

```auto
SENTRY:
        DSN: eventlet+${SENTRY_DSN:https://user:pass@localhost/00000}

```

---

<div class="post-metadata">

**Author:** ![mattbennett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/mattbennett/32/13_2.png) [@mattbennett](https://discourse.nameko.io/u/mattbennett)\
**Post date:** [June 9, 2020, 11:13am UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/3 "2020-06-09T11:13:13Z")

</div>

@ksimmi I think the problem here is that the legacy Raven client has finally stopped being supported.

nameko-sentry needs an upgrade to the newer sentry-sdk. There has been [some effort to do this](https://github.com/nameko/nameko-sentry/issues/24), but I guess it’s urgent now.

---

<div class="post-metadata">

**Author:** ![zsiciarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/zsiciarz/32/58_2.png) [@zsiciarz](https://discourse.nameko.io/u/zsiciarz)\
**Post date:** [July 4, 2020, 11:38am UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/4 "2020-07-04T11:38:34Z")

</div>

It was me who started the mentioned Github issue and I apologize for not moving forward. I couldn’t get the tests to deterministically pass or fail and they don’t run on Travis CI (there’s a PR that fixes that part).

However, this is curious. We’re using nameko\_sentry in production and it still works for us. For example:

```
from nameko.rpc import rpc
from nameko.web.handlers import http
from nameko_sentry import SentryReporter

class Service:
    name = "crasher_service"
    sentry = SentryReporter()

    @rpc
    def crash(self):
        raise Exception("oops, I crashed")

    @http("GET", "/")
    def crash_http(self, request):
        raise Exception("http crashed")

```

Both RPC and HTTP exceptions get logged to our Sentry instance. This is under Python 3.6.6 with the following dependencies:

```
$ pip freeze
amqp==2.6.0
certifi==2020.6.20
chardet==3.0.4
dnspython==1.16.0
eventlet==0.25.2
greenlet==0.4.16
idna==2.10
importlib-metadata==1.7.0
kombu==4.6.11
mock==4.0.2
monotonic==1.5
nameko==2.12.0
nameko-sentry==1.0.0
path==13.1.0
path.py==12.4.0
PyYAML==5.3.1
raven==6.10.0
requests==2.24.0
six==1.15.0
urllib3==1.25.9
vine==1.3.0
Werkzeug==1.0.1
wrapt==1.12.1
zipp==3.1.0

```

When I tried to run the same service under Python 3.8.1 with the same dependencies, indeed no exceptions were logged to Sentry. There’s still an [unsolved eventlet issue](https://github.com/eventlet/eventlet/issues/526) with outgoing HTTPS requests on Python 3.7+, so perhaps that’s what happens somewhere within raven.  
However this is no excuse not to switch from raven to sentry-sdk and I guess we should double down on that.

---

<div class="post-metadata">

**Author:** ![mattbennett](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/mattbennett/32/13_2.png) [@mattbennett](https://discourse.nameko.io/u/mattbennett)\
**Post date:** [July 6, 2020, 1:12pm UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/5 "2020-07-06T13:12:13Z")

</div>

Ah, now you’ve reminded me about that eventlet issue, I remember downgrading to Py3.6 on a previous project to fix sentry reporting.

A curious workaround has since been discovered for that eventlet issue – installing PyOpenSSL version 19.1.0. This fixes eventlet, but I have not tested whether it solves this problem yet.

In any case, as you say, not an excuse not to switch from raven to sentry-sdk.

---

<div class="post-metadata">

**Author:** ![zsiciarz](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/zsiciarz/32/58_2.png) [@zsiciarz](https://discourse.nameko.io/u/zsiciarz)\
**Post date:** [July 6, 2020, 3:38pm UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/6 "2020-07-06T15:38:01Z")

</div>

> [@mattbennett](#):
>
> A curious workaround has since been discovered for that eventlet issue – installing PyOpenSSL version 19.1.0. This fixes eventlet, but I have not tested whether it solves this problem yet.

[Slightly OT] And yet that workaround doesn’t work in every case. I’ve had some small nameko services run just fine on Python 3.8, including posting to https:// URLs (with PyOpenSSL installed), while others crashed. However, [this commit](https://github.com/eventlet/eventlet/commit/02fa826d22d0df7f9379c3a1e5cd2192e0ffadd8) seems to fix the eventlet issue entirely (fingers crossed).

**Update** : I can confirm that installing eventlet from that commit seems to fix reporting to Sentry on Python 3.8 (in my crasher\_service example).

---

<div class="post-metadata">

**Author:** ![vashchukmaksim](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.nameko.io/vashchukmaksim/32/84_2.png) [@vashchukmaksim](https://discourse.nameko.io/u/vashchukmaksim)\
**Post date:** [November 25, 2020, 10:30pm UTC](https://discourse.nameko.io/t/nameko-sentry-cant-report-to-sentry/560/7 "2020-11-25T22:30:05Z")

</div>

Hi everyone! Any updates on sentry sdk migration?
