Events getting silently dropped
See original GitHub issueHow do you use Sentry?
Sentry Saas (sentry.io)
Version
1.5.6
Steps to Reproduce
Unfortunately I haven’t figured out how to reproduce this. 99.9% of errors (not a real stat) get sent as expected. It seems to happen randomly. I am logging exceptions to a custom logger in the before_send
function like this, followed by my init
call:
import traceback
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.integrations.redis import RedisIntegration
sentry_sent_logger = logging.getLogger('sentry-sent')
def before_send(event, hint):
tb = '\n'.join(traceback.format_tb(hint['exc_info'][2]))
log_str = f'\ntraceback: {tb}\n-----'
sentry_sent_logger.info(log_str)
return event
sentry_sdk.init(
dsn=env.get_sentry_io_url(),
integrations=[DjangoIntegration(), FlaskIntegration(), RedisIntegration()],
debug=True,
traces_sample_rate=0.0,
send_default_pii=True,
before_send=before_send
)
I am always returning the event from before_send
. At 04:07 EST this morning a stack trace of an exception was written to my logs by the sentry_sent_logger
. This error does not exist in my sentry.io UI.
I have been running with debug=True
since I have noticed this happening before. Below are the sentry_sdk
logs at the same time. There is nothing logged by sentry_sdk
at the time of the dropped exception.
2022-04-08 00:04:04,682 - sentry_sdk.errors - DEBUG - [Tracing] Discarding <http.server> transaction <generic WSGI request> because traces_sample_rate is set to 0
2022-04-08 00:04:04,684 - sentry_sdk.errors - DEBUG - Discarding transaction because sampled = False
2022-04-08 00:04:04,684 - sentry_sdk.errors - INFO - Discarded session update because of missing release
2022-04-08 00:04:06,275 - sentry_sdk.errors - DEBUG - [Tracing] Discarding <http.server> transaction <generic WSGI request> because traces_sample_rate is set to 0
2022-04-08 00:04:06,277 - sentry_sdk.errors - DEBUG - Discarding transaction because sampled = False
2022-04-08 00:04:06,277 - sentry_sdk.errors - INFO - Discarded session update because of missing release
2022-04-08 00:04:10,850 - sentry_sdk.errors - DEBUG - [Tracing] Discarding <http.server> transaction <generic WSGI request> because traces_sample_rate is set to 0
2022-04-08 00:04:10,852 - sentry_sdk.errors - DEBUG - Discarding transaction because sampled = False
2022-04-08 00:04:10,852 - sentry_sdk.errors - INFO - Discarded session update because of missing release
I honestly cannot figure out what is happening. I have to assume something is happening between the before_send
function and the event actually sending. Please let me know if you need more info.
Expected Result
Sentry sends the errors to sentry.io.
Actual Result
Sentry does not send the errors to sentry.io.
Issue Analytics
- State:
- Created a year ago
- Comments:11 (5 by maintainers)
Top GitHub Comments
@blaketeres exposing these stats to the end user is on the product roadmap, but I can’t give you an ETA on when that will be shipped unfortunately.
here’s a couple of days in the last week, you still have a lot of
Network Error
s.Thanks for looking into this. I assumed it was an issue with the client. I’ll contact support.