@@ -19,20 +19,27 @@ import (
19
19
"sync"
20
20
)
21
21
22
- // SpanProcessor is interface to add hooks to start and end method invocations.
22
+ // SpanProcessor is a processing pipeline for spans in the trace signal.
23
+ // SpanProcessors registered with a TracerProvider and are called at the start
24
+ // and end of a Span's lifecycle, and are called in the order they are
25
+ // registered.
23
26
type SpanProcessor interface {
24
-
25
- // OnStart method is invoked when span is started. It is a synchronous call
26
- // and hence should not block.
27
+ // OnStart is called when a span is started. It is called synchronously
28
+ // and should not block.
27
29
OnStart (parent context.Context , s ReadWriteSpan )
28
30
29
- // OnEnd method is invoked when span is finished. It is a synchronous call
30
- // and hence should not block.
31
+ // OnEnd is called when span is finished. It is called synchronously and
32
+ // hence not block.
31
33
OnEnd (s ReadOnlySpan )
32
34
33
- // Shutdown is invoked when SDK shuts down. Use this call to cleanup any processor
34
- // data. No calls to OnStart and OnEnd method is invoked after Shutdown call is
35
- // made. It should not be blocked indefinitely.
35
+ // Shutdown is called when the SDK shuts down. Any cleanup or release of
36
+ // resources held by the processor should be done in this call.
37
+ //
38
+ // Calls to OnStart, OnEnd, or ForceFlush after this has been called
39
+ // should be ignored.
40
+ //
41
+ // All timeouts and cancellations contained in ctx must be honored, this
42
+ // should not block indefinitely.
36
43
Shutdown (ctx context.Context ) error
37
44
38
45
// ForceFlush exports all ended spans to the configured Exporter that have not yet
0 commit comments