Search code examples
pythonsentryraven

sentry POST data is not being propagated to the UI


I’m having an issue with the python sdk for sentry on a server that I’m running. On POST requests the body is being suppressed/not being sent to the sentry UI, and I can’t figure out why.

I’m declaring the client like so:

ignore_exceptions = ['HTTPNotFound']
sentry_client = Client(
    SENTRY_DSN,
    ignore_exceptions=ignore_exceptions
)

As far as I can tell, to NOT include post data you need to also pass something akin to

processors = (
    'raven.processors.RemovePostDataProcessor',
)

(I read that in the documentation here under the sanitization section)

I'm definitely not passing that, so I'm confused about why the body isn't showing up anywhere. Is there some sort of default I need to override? Am I missing something obvious?

Thanks so much for any help, and let me know if I can clarify/improve my question at all.


Solution

  • Okay, ultimately figured this out. It wasn't really an issue with sentry itself, it's that I'd been passing an empty value to the data object.

    I'd been using the logic at the end of this page to send things to sentry. As it happened, request.params was empty. I ultimately needed to return request.stream.read(request.content_length or 0).decode('utf-8') instead. My understanding is that sentry doesn't use request.params for JSON bodies, but I'm not exactly sure of that.

    Hopefully this helps somebody down the road!