Skip to content

Commit

Permalink
Fix the improperly formatted link trace ID (googleapis#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll committed Apr 12, 2018
1 parent 53ede72 commit c7be888
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions exporter/stackdriver/trace_proto.go
Expand Up @@ -15,7 +15,6 @@
package stackdriver

import (
"fmt"
"math"
"time"
"unicode/utf8"
Expand Down Expand Up @@ -144,15 +143,14 @@ func protoFromSpanData(s *trace.SpanData, projectID string) *tracepb.Span {
sp.Links.Link = make([]*tracepb.Span_Link, 0, len(s.Links))
for _, l := range s.Links {
link := &tracepb.Span_Link{
TraceId: fmt.Sprintf("projects/%s/traces/%s", projectID, l.TraceID),
TraceId: l.TraceID.String(),
SpanId: l.SpanID.String(),
Type: tracepb.Span_Link_Type(l.Type),
}
copyAttributes(&link.Attributes, l.Attributes)
sp.Links.Link = append(sp.Links.Link, link)
}
}

return sp
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/stackdriver/trace_proto_test.go
Expand Up @@ -289,7 +289,7 @@ func TestExportTrace(t *testing.T) {
Links: &tracepb.Span_Links{
Link: []*tracepb.Span_Link{
{
TraceId: "projects/testproject/traces/01020000000000000000000000000000",
TraceId: "01020000000000000000000000000000",
SpanId: "0300000000000000",
Type: tracepb.Span_Link_PARENT_LINKED_SPAN,
Attributes: &tracepb.Span_Attributes{
Expand Down

0 comments on commit c7be888

Please sign in to comment.