1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-27 22:49:15 +02:00

Batched span processor (#154)

* add batch span processor.

* add blocking support.

* use With* function for options.
- also changed how Shutdown is handled.

* block Shutdown until queue is flushed.

* fix comment.
This commit is contained in:
rghetia
2019-10-01 13:50:51 -07:00
committed by GitHub
parent a936b8fb00
commit 3d5b2fa328
5 changed files with 433 additions and 5 deletions

View File

@@ -60,7 +60,7 @@ func RegisterSpanProcessor(e SpanProcessor) {
// UnregisterSpanProcessor removes from the list of SpanProcessors the SpanProcessor that was
// registered with the given name.
func UnregisterSpanProcessor(e SpanProcessor) {
func UnregisterSpanProcessor(s SpanProcessor) {
mu.Lock()
defer mu.Unlock()
new := make(spanProcessorMap)
@@ -69,6 +69,7 @@ func UnregisterSpanProcessor(e SpanProcessor) {
new[k] = v
}
}
delete(new, e)
delete(new, s)
spanProcessors.Store(new)
s.Shutdown()
}