Skip to content

Commit

Permalink
Update test cases and comments based on review.
Browse files Browse the repository at this point in the history
  • Loading branch information
q-cheng committed Mar 27, 2024
1 parent 484648b commit 55fc6fb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
8 changes: 4 additions & 4 deletions sdk/trace/trace_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1977,7 +1977,7 @@ func TestEmptyRecordingSpanDroppedAttributes(t *testing.T) {
assert.Equal(t, 0, (&recordingSpan{}).DroppedAttributes())
}

func TestAddSpanWithInvalidSpanContext(t *testing.T) {
func TestAddLinkWithInvalidSpanContext(t *testing.T) {
te := NewTestExporter()
sl := NewSpanLimits()
tp := NewTracerProvider(
Expand Down Expand Up @@ -2012,11 +2012,11 @@ func TestAddSpanWithInvalidSpanContext(t *testing.T) {
t.Fatal(err)
}
if diff := cmpDiff(got, want); diff != "" {
t.Errorf("Link: -got +want %s", diff)
t.Errorf("AddLinkWithInvalidSpanContext: -got +want %s", diff)
}
}

func TestAddSpan(t *testing.T) {
func TestAddLink(t *testing.T) {
te := NewTestExporter()
sl := NewSpanLimits()
tp := NewTracerProvider(
Expand Down Expand Up @@ -2051,6 +2051,6 @@ func TestAddSpan(t *testing.T) {
t.Fatal(err)
}
if diff := cmpDiff(got, want); diff != "" {
t.Errorf("Link: -got +want %s", diff)
t.Errorf("AddLink: -got +want %s", diff)
}
}
5 changes: 4 additions & 1 deletion trace/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,10 @@ type Span interface {
// AddEvent adds an event with the provided name and options.
AddEvent(name string, options ...EventOption)

// AddLink adds link after span starts.
// AddLink adds a link.
// Adding links at span creation using WithLinks is preferred to calling AddLink
// later, for contexts that are available during span creation, because head
// sampling decisions can only consider information present during span creation.
AddLink(link Link)

// IsRecording returns the recording state of the Span. It will return
Expand Down

0 comments on commit 55fc6fb

Please sign in to comment.