@@ -1015,13 +1015,7 @@ public void captureSession(final @NotNull Session session, final @Nullable Hint
10151015 SentryLevel .DEBUG ,
10161016 "Transaction was dropped as transaction name %s is ignored" ,
10171017 transaction .getTransaction ());
1018- options
1019- .getClientReportRecorder ()
1020- .recordLostEvent (DiscardReason .EVENT_PROCESSOR , DataCategory .Transaction );
1021- options
1022- .getClientReportRecorder ()
1023- .recordLostEvent (
1024- DiscardReason .EVENT_PROCESSOR , DataCategory .Span , transaction .getSpans ().size () + 1 );
1018+ recordLostTransactionAndSpans (transaction );
10251019 return SentryId .EMPTY_ID ;
10261020 }
10271021
@@ -1033,13 +1027,7 @@ public void captureSession(final @NotNull Session session, final @Nullable Hint
10331027 SentryLevel .DEBUG ,
10341028 "Transaction was dropped as HTTP status code %d is ignored" ,
10351029 ignoredHttpStatusCode );
1036- options
1037- .getClientReportRecorder ()
1038- .recordLostEvent (DiscardReason .EVENT_PROCESSOR , DataCategory .Transaction );
1039- options
1040- .getClientReportRecorder ()
1041- .recordLostEvent (
1042- DiscardReason .EVENT_PROCESSOR , DataCategory .Span , transaction .getSpans ().size () + 1 );
1030+ recordLostTransactionAndSpans (transaction );
10431031 if (profilingTraceData != null ) {
10441032 options
10451033 .getClientReportRecorder ()
@@ -1121,6 +1109,16 @@ public void captureSession(final @NotNull Session session, final @Nullable Hint
11211109 return sentryId ;
11221110 }
11231111
1112+ private void recordLostTransactionAndSpans (final @ NotNull SentryTransaction transaction ) {
1113+ options
1114+ .getClientReportRecorder ()
1115+ .recordLostEvent (DiscardReason .EVENT_PROCESSOR , DataCategory .Transaction );
1116+ options
1117+ .getClientReportRecorder ()
1118+ .recordLostEvent (
1119+ DiscardReason .EVENT_PROCESSOR , DataCategory .Span , transaction .getSpans ().size () + 1 );
1120+ }
1121+
11241122 private @ Nullable Integer getIgnoredHttpStatusCode (final @ NotNull SentryTransaction transaction ) {
11251123 final @ Nullable List <HttpStatusCodeRange > ignoredHttpStatusCodes =
11261124 options .getTraceIgnoreStatusCodes ();
0 commit comments