66import io .sentry .ISentryLifecycleToken ;
77import io .sentry .ITransaction ;
88import io .sentry .ScopesAdapter ;
9+ import io .sentry .SentryLevel ;
910import io .sentry .SentryTraceHeader ;
1011import io .sentry .SpanDataConvention ;
1112import io .sentry .SpanStatus ;
@@ -83,7 +84,11 @@ <K, V, U> U withTracingImpl(
8384 try {
8485 forkedScopes = scopes .forkedRootScopes (CREATOR );
8586 lifecycleToken = forkedScopes .makeCurrent ();
86- } catch (Throwable ignored ) {
87+ } catch (Throwable t ) {
88+ scopes
89+ .getOptions ()
90+ .getLogger ()
91+ .log (SentryLevel .ERROR , "Failed to fork scopes for Kafka consumer tracing." , t );
8792 return callable .call ();
8893 }
8994
@@ -175,7 +180,11 @@ private boolean isIgnored() {
175180 }
176181
177182 return transaction ;
178- } catch (Throwable ignored ) {
183+ } catch (Throwable t ) {
184+ scopes
185+ .getOptions ()
186+ .getLogger ()
187+ .log (SentryLevel .ERROR , "Failed to start Kafka consumer tracing transaction." , t );
179188 return null ;
180189 }
181190 }
@@ -194,8 +203,12 @@ private void finishTransaction(
194203 transaction .setThrowable (throwable );
195204 }
196205 transaction .finish ();
197- } catch (Throwable ignored ) {
206+ } catch (Throwable t ) {
198207 // Instrumentation must never break customer processing.
208+ scopes
209+ .getOptions ()
210+ .getLogger ()
211+ .log (SentryLevel .ERROR , "Failed to finish Kafka consumer tracing transaction." , t );
199212 }
200213 }
201214
0 commit comments