Skip to content

Commit

Permalink
Implement the Span.TracerProvider method
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Sep 19, 2024
1 parent effdec9 commit 1ad8061
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
4 changes: 1 addition & 3 deletions sdk/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,4 @@ func (s *span) SetName(name string) {
/* TODO: implement */
}

func (*span) TracerProvider() trace.TracerProvider {
return GetTracerProvider()
}
func (*span) TracerProvider() trace.TracerProvider { return GetTracerProvider() }
7 changes: 7 additions & 0 deletions sdk/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,10 @@ func TestSpanNilUnsampledGuards(t *testing.T) {
t.Run("SetAttributes", run(func(s *span) { s.SetAttributes(attrs...) }))
t.Run("TracerProvider", run(func(s *span) { _ = s.TracerProvider() }))
}

func TestSpanTracerProvider(t *testing.T) {
var s span

got := s.TracerProvider()
assert.IsType(t, tracerProvider{}, got)
}

0 comments on commit 1ad8061

Please sign in to comment.