Obtaining Transport Result in Java SDK

Hi,

I am migrating from SDK 1.7 to 5.1 and am having trouble capturing success/failure transport errors in 5.1.

My 1.7 code uses a callback:
Sentry.getStoredClient().addEventSendCallback(new EventSendCallback() {
@Override
public void onFailure(io.sentry.event.Event event, Exception e) {
Observability.getLogger().error(“Failed to send to Sentry” + event.getId(), e);
}

        @Override
        public void onSuccess(io.sentry.event.Event event) {
            Observability.getLogger().debug("Sent to Sentry" + event.getId());
        }
    });

However, I do not know how to achieve the same result in 5.1. Does anyone have any pointers?

Thanks

Hi @Lee_Gw,

in the SDK v3+ (including 5.1) there is no way currently to add a callback like this. If the problem is that events that should be send, don’t appear in the dashboard, consider switching debug on the SentryOptions when Sentry SDK is initialized - you will see quite a lot of output in the console.

However, if your usecase is different, you can create an issue in GitHub - getsentry/sentry-java: A Sentry SDK for Java, Android and other JVM languages.

Thanks for the quick reply. Appreciate it.

1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.