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 7
7
8
8
import io .opentelemetry .api .metrics .MeterProvider ;
9
9
import io .opentelemetry .exporter .internal .ExporterMetrics ;
10
+ import io .opentelemetry .exporter .internal .InstrumentationUtil ;
10
11
import io .opentelemetry .sdk .common .CompletableResultCode ;
11
12
import io .opentelemetry .sdk .internal .ThrottlingLogger ;
12
13
import io .opentelemetry .sdk .trace .data .SpanData ;
@@ -75,15 +76,19 @@ public CompletableResultCode export(Collection<SpanData> spanDataList) {
75
76
encodedSpans .add (encoder .encode (zipkinSpan ));
76
77
}
77
78
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 ;
87
92
}
88
93
89
94
@ Override
You can’t perform that action at this time.
0 commit comments