Skip to content
This repository was archived by the owner on Oct 3, 2023. It is now read-only.

Commit c7be888

Browse files
authored
Fix the improperly formatted link trace ID (#697)
Fixes #690.
1 parent 53ede72 commit c7be888

2 files changed

Lines changed: 2 additions & 4 deletions

File tree

exporter/stackdriver/trace_proto.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
package stackdriver
1616

1717
import (
18-
"fmt"
1918
"math"
2019
"time"
2120
"unicode/utf8"
@@ -144,15 +143,14 @@ func protoFromSpanData(s *trace.SpanData, projectID string) *tracepb.Span {
144143
sp.Links.Link = make([]*tracepb.Span_Link, 0, len(s.Links))
145144
for _, l := range s.Links {
146145
link := &tracepb.Span_Link{
147-
TraceId: fmt.Sprintf("projects/%s/traces/%s", projectID, l.TraceID),
146+
TraceId: l.TraceID.String(),
148147
SpanId: l.SpanID.String(),
149148
Type: tracepb.Span_Link_Type(l.Type),
150149
}
151150
copyAttributes(&link.Attributes, l.Attributes)
152151
sp.Links.Link = append(sp.Links.Link, link)
153152
}
154153
}
155-
156154
return sp
157155
}
158156

exporter/stackdriver/trace_proto_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ func TestExportTrace(t *testing.T) {
289289
Links: &tracepb.Span_Links{
290290
Link: []*tracepb.Span_Link{
291291
{
292-
TraceId: "projects/testproject/traces/01020000000000000000000000000000",
292+
TraceId: "01020000000000000000000000000000",
293293
SpanId: "0300000000000000",
294294
Type: tracepb.Span_Link_PARENT_LINKED_SPAN,
295295
Attributes: &tracepb.Span_Attributes{

0 commit comments

Comments
 (0)