Skip to content

Commit

Permalink
make the span exporter flush result after export
Browse files Browse the repository at this point in the history
  • Loading branch information
arriIsHere committed Dec 12, 2024
1 parent a0261fa commit f210998
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,12 @@ private class BatchWorker: Thread {
stride(from: 0, to: spanList.endIndex, by: maxExportBatchSize).forEach {
var spansToExport = spanList[$0 ..< min($0 + maxExportBatchSize, spanList.count)].map { $0.toSpanData() }
willExportCallback?(&spansToExport)
let result = spanExporter.export(spans: spansToExport, explicitTimeout: explicitTimeout)
var result = spanExporter.export(spans: spansToExport, explicitTimeout: explicitTimeout)

if result == .success {
result = spanExporter.flush(explicitTimeout: explicitTimeout)
}

if result == .success {
cond.lock()
processedSpansCounter?.add(value: spanList.count, attribute: [
Expand Down

0 comments on commit f210998

Please sign in to comment.