Skip to content

Commit fde3e6b

Browse files
committed
Adding FinishedWithDuration to Span interface
1 parent 4d0ee15 commit fde3e6b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

noop.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,6 @@ func (*noopSpan) Tag(string, string) {}
3636

3737
func (*noopSpan) Finish() {}
3838

39+
func (*noopSpan) FinishedWithDuration(duration time.Duration) {}
40+
3941
func (*noopSpan) Flush() {}

span.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ type Span interface {
4545
// span.Flush).
4646
Finish()
4747

48+
// Finish the Span with duration and send to Reporter. If DelaySend option was used at
49+
// Span creation time, FinishedWithDuration will not send the Span to the Reporter. It then
50+
// becomes the user's responsibility to get the Span reported (by using
51+
// span.Flush).
52+
FinishedWithDuration(duration time.Duration)
53+
4854
// Flush the Span to the Reporter (regardless of being finished or not).
4955
// This can be used if the DelaySend SpanOption was set or when dealing with
5056
// one-way RPC tracing where duration might not be measured.

0 commit comments

Comments
 (0)