Skip to content

Commit 13938ab

Browse files
authored
Update SpanProcessor docs (#1611)
Included all directives from the specification, clarify english, and translate specifics for the Go language.
1 parent e25503a commit 13938ab

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

sdk/trace/span_processor.go

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,27 @@ import (
1919
"sync"
2020
)
2121

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.
2326
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.
2729
OnStart(parent context.Context, s ReadWriteSpan)
2830

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.
3133
OnEnd(s ReadOnlySpan)
3234

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.
3643
Shutdown(ctx context.Context) error
3744

3845
// ForceFlush exports all ended spans to the configured Exporter that have not yet

0 commit comments

Comments
 (0)