File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
exporters/zipkin/src/main/java/io/opentelemetry/exporter/zipkin Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change 77
88import io .opentelemetry .api .metrics .MeterProvider ;
99import io .opentelemetry .exporter .internal .ExporterMetrics ;
10+ import io .opentelemetry .exporter .internal .InstrumentationUtil ;
1011import io .opentelemetry .sdk .common .CompletableResultCode ;
1112import io .opentelemetry .sdk .internal .ThrottlingLogger ;
1213import io .opentelemetry .sdk .trace .data .SpanData ;
@@ -75,15 +76,19 @@ public CompletableResultCode export(Collection<SpanData> spanDataList) {
7576 encodedSpans .add (encoder .encode (zipkinSpan ));
7677 }
7778
78- try {
79- sender .send (encodedSpans );
80- exporterMetrics .addSuccess (numItems );
81- return CompletableResultCode .ofSuccess ();
82- } catch (IOException | RuntimeException t ) {
83- exporterMetrics .addFailed (numItems );
84- logger .log (Level .WARNING , "Failed to export spans" , t );
85- return CompletableResultCode .ofFailure ();
86- }
79+ CompletableResultCode resultCode = new CompletableResultCode ();
80+ InstrumentationUtil .suppressInstrumentation (() -> {
81+ try {
82+ sender .send (encodedSpans );
83+ exporterMetrics .addSuccess (numItems );
84+ resultCode .succeed ();
85+ } catch (IOException | RuntimeException e ) {
86+ exporterMetrics .addFailed (numItems );
87+ logger .log (Level .WARNING , "Failed to export spans" , e );
88+ resultCode .fail ();
89+ }
90+ });
91+ return resultCode ;
8792 }
8893
8994 @ Override
You can’t perform that action at this time.
0 commit comments