Skip to content
This repository has been archived by the owner on Jul 31, 2023. It is now read-only.

Fix the improperly formatted link trace ID #697

Merged
merged 1 commit into from
Apr 12, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions exporter/stackdriver/trace_proto.go
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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