Skip to content

Commit 3bf3927

Browse files
authoredMar 7, 2020
Add status message parameter (#524)
* Add status message parameter * Cleanups around use of codes.OK * Update for status message
1 parent 5850278 commit 3bf3927

File tree

21 files changed

+109
-97
lines changed

21 files changed

+109
-97
lines changed
 

‎api/testharness/harness.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ func (h *Harness) testSpan(tracerFactory func() trace.Tracer) {
323323
span.AddEventWithTimestamp(context.Background(), time.Now(), "test event")
324324
},
325325
"#SetStatus": func(span trace.Span) {
326-
span.SetStatus(codes.Internal)
326+
span.SetStatus(codes.Internal, "internal")
327327
},
328328
"#SetName": func(span trace.Span) {
329329
span.SetName("new name")

‎api/trace/api.go

+11-6
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ func WithEndTime(t time.Time) EndOption {
6262

6363
// ErrorConfig provides options to set properties of an error event at the time it is recorded.
6464
type ErrorConfig struct {
65-
Timestamp time.Time
66-
Status codes.Code
65+
Timestamp time.Time
66+
StatusCode codes.Code
6767
}
6868

6969
// ErrorOption applies changes to ErrorConfig that sets options when an error event is recorded.
@@ -79,7 +79,7 @@ func WithErrorTime(t time.Time) ErrorOption {
7979
// WithErrorStatus indicates the span status that should be set when recording an error event.
8080
func WithErrorStatus(s codes.Code) ErrorOption {
8181
return func(c *ErrorConfig) {
82-
c.Status = s
82+
c.StatusCode = s
8383
}
8484
}
8585

@@ -107,9 +107,14 @@ type Span interface {
107107
// even after the span ends.
108108
SpanContext() core.SpanContext
109109

110-
// SetStatus sets the status of the span. The status of the span can be updated
111-
// even after span ends.
112-
SetStatus(codes.Code)
110+
// SetStatus sets the status of the span in the form of a code
111+
// and a message. SetStatus overrides the value of previous
112+
// calls to SetStatus on the Span.
113+
//
114+
// The default span status is OK, so it is not necessary to
115+
// explicitly set an OK status on successful Spans unless it
116+
// is to add an OK message or to override a previous status on the Span.
117+
SetStatus(codes.Code, string)
113118

114119
// SetName sets the name of the span.
115120
SetName(name string)

‎api/trace/context_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func (mockSpan) IsRecording() bool {
6868
}
6969

7070
// SetStatus does nothing.
71-
func (mockSpan) SetStatus(status codes.Code) {
71+
func (mockSpan) SetStatus(status codes.Code, msg string) {
7272
}
7373

7474
// SetName does nothing.

‎api/trace/noop_span.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (NoopSpan) IsRecording() bool {
3939
}
4040

4141
// SetStatus does nothing.
42-
func (NoopSpan) SetStatus(status codes.Code) {
42+
func (NoopSpan) SetStatus(status codes.Code, msg string) {
4343
}
4444

4545
// SetError does nothing.

‎api/trace/testtrace/span.go

+26-18
Original file line numberDiff line numberDiff line change
@@ -36,18 +36,19 @@ const (
3636
var _ trace.Span = (*Span)(nil)
3737

3838
type Span struct {
39-
lock *sync.RWMutex
40-
tracer *Tracer
41-
spanContext core.SpanContext
42-
parentSpanID core.SpanID
43-
ended bool
44-
name string
45-
startTime time.Time
46-
endTime time.Time
47-
status codes.Code
48-
attributes map[core.Key]core.Value
49-
events []Event
50-
links map[core.SpanContext][]core.KeyValue
39+
lock *sync.RWMutex
40+
tracer *Tracer
41+
spanContext core.SpanContext
42+
parentSpanID core.SpanID
43+
ended bool
44+
name string
45+
startTime time.Time
46+
endTime time.Time
47+
statusCode codes.Code
48+
statusMessage string
49+
attributes map[core.Key]core.Value
50+
events []Event
51+
links map[core.SpanContext][]core.KeyValue
5152
}
5253

5354
func (s *Span) Tracer() trace.Tracer {
@@ -91,8 +92,8 @@ func (s *Span) RecordError(ctx context.Context, err error, opts ...trace.ErrorOp
9192
cfg.Timestamp = time.Now()
9293
}
9394

94-
if cfg.Status != codes.OK {
95-
s.SetStatus(cfg.Status)
95+
if cfg.StatusCode != codes.OK {
96+
s.SetStatus(cfg.StatusCode, "")
9697
}
9798

9899
errType := reflect.TypeOf(err)
@@ -140,15 +141,16 @@ func (s *Span) SpanContext() core.SpanContext {
140141
return s.spanContext
141142
}
142143

143-
func (s *Span) SetStatus(status codes.Code) {
144+
func (s *Span) SetStatus(code codes.Code, msg string) {
144145
s.lock.Lock()
145146
defer s.lock.Unlock()
146147

147148
if s.ended {
148149
return
149150
}
150151

151-
s.status = status
152+
s.statusCode = code
153+
s.statusMessage = msg
152154
}
153155

154156
func (s *Span) SetName(name string) {
@@ -245,6 +247,12 @@ func (s *Span) Ended() bool {
245247
// Status returns the status most recently set on the Span,
246248
// or codes.OK if no status has been explicitly set.
247249
// It cannot be changed after End has been called on the Span.
248-
func (s *Span) Status() codes.Code {
249-
return s.status
250+
func (s *Span) StatusCode() codes.Code {
251+
return s.statusCode
252+
}
253+
254+
// StatusMessage returns the status message most recently set on the
255+
// Span or the empty string if no status mesaage was set.
256+
func (s *Span) StatusMessage() string {
257+
return s.statusMessage
250258
}

‎api/trace/testtrace/span_test.go

+16-12
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ package testtrace_test
1717
import (
1818
"context"
1919
"errors"
20+
"fmt"
2021
"sync"
2122
"testing"
2223
"time"
@@ -164,7 +165,8 @@ func TestSpan(t *testing.T) {
164165
},
165166
}}
166167
e.Expect(subject.Events()).ToEqual(expectedEvents)
167-
e.Expect(subject.Status()).ToEqual(codes.OK)
168+
e.Expect(subject.StatusCode()).ToEqual(codes.OK)
169+
e.Expect(subject.StatusMessage()).ToEqual("")
168170
}
169171
})
170172

@@ -182,8 +184,8 @@ func TestSpan(t *testing.T) {
182184
errMsg := "test error message"
183185
testErr := ottest.NewTestError(errMsg)
184186
testTime := time.Now()
185-
expStatus := codes.Unknown
186-
subject.RecordError(ctx, testErr, trace.WithErrorTime(testTime), trace.WithErrorStatus(expStatus))
187+
expStatusCode := codes.Unknown
188+
subject.RecordError(ctx, testErr, trace.WithErrorTime(testTime), trace.WithErrorStatus(expStatusCode))
187189

188190
expectedEvents := []testtrace.Event{{
189191
Timestamp: testTime,
@@ -194,7 +196,7 @@ func TestSpan(t *testing.T) {
194196
},
195197
}}
196198
e.Expect(subject.Events()).ToEqual(expectedEvents)
197-
e.Expect(subject.Status()).ToEqual(expStatus)
199+
e.Expect(subject.StatusCode()).ToEqual(expStatusCode)
198200
})
199201

200202
t.Run("cannot be set after the span has ended", func(t *testing.T) {
@@ -527,11 +529,11 @@ func TestSpan(t *testing.T) {
527529
subject, ok := span.(*testtrace.Span)
528530
e.Expect(ok).ToBeTrue()
529531

530-
e.Expect(subject.Status()).ToEqual(codes.OK)
532+
e.Expect(subject.StatusCode()).ToEqual(codes.OK)
531533

532534
subject.End()
533535

534-
e.Expect(subject.Status()).ToEqual(codes.OK)
536+
e.Expect(subject.StatusCode()).ToEqual(codes.OK)
535537
})
536538

537539
statuses := []codes.Code{
@@ -566,10 +568,11 @@ func TestSpan(t *testing.T) {
566568
subject, ok := span.(*testtrace.Span)
567569
e.Expect(ok).ToBeTrue()
568570

569-
subject.SetStatus(codes.OK)
570-
subject.SetStatus(status)
571+
subject.SetStatus(codes.OK, "OK")
572+
subject.SetStatus(status, "Yo!")
571573

572-
e.Expect(subject.Status()).ToEqual(status)
574+
e.Expect(subject.StatusCode()).ToEqual(status)
575+
e.Expect(subject.StatusMessage()).ToEqual("Yo!")
573576
})
574577

575578
t.Run("cannot be changed after the span has been ended", func(t *testing.T) {
@@ -585,11 +588,12 @@ func TestSpan(t *testing.T) {
585588

586589
originalStatus := codes.OK
587590

588-
subject.SetStatus(originalStatus)
591+
subject.SetStatus(originalStatus, "OK")
589592
subject.End()
590-
subject.SetStatus(status)
593+
subject.SetStatus(status, fmt.Sprint(status))
591594

592-
e.Expect(subject.Status()).ToEqual(originalStatus)
595+
e.Expect(subject.StatusCode()).ToEqual(originalStatus)
596+
e.Expect(subject.StatusMessage()).ToEqual("OK")
593597
})
594598
}
595599
})

‎bridge/opentracing/bridge.go

+3-7
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,8 @@ func (s *bridgeSpan) SetTag(key string, value interface{}) ot.Span {
124124
case string(otext.SpanKind):
125125
// TODO: Should we ignore it?
126126
case string(otext.Error):
127-
if b, ok := value.(bool); ok {
128-
status := codes.OK
129-
if b {
130-
status = codes.Unknown
131-
}
132-
s.otelSpan.SetStatus(status)
127+
if b, ok := value.(bool); ok && b {
128+
s.otelSpan.SetStatus(codes.Unknown, "")
133129
}
134130
default:
135131
s.otelSpan.SetAttributes(otTagToOtelCoreKeyValue(key, value))
@@ -330,7 +326,7 @@ func (t *BridgeTracer) StartSpan(operationName string, opts ...ot.StartSpanOptio
330326
})
331327
}
332328
if hadTrueErrorTag {
333-
otelSpan.SetStatus(codes.Unknown)
329+
otelSpan.SetStatus(codes.Unknown, "")
334330
}
335331
// One does not simply pass a concrete pointer to function
336332
// that takes some interface. In case of passing nil concrete

‎bridge/opentracing/internal/mock.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ import (
3333
)
3434

3535
var (
36-
ComponentKey = otelkey.New("component")
37-
ServiceKey = otelkey.New("service")
38-
StatusKey = otelkey.New("status")
39-
ErrorKey = otelkey.New("error")
40-
NameKey = otelkey.New("name")
36+
ComponentKey = otelkey.New("component")
37+
ServiceKey = otelkey.New("service")
38+
StatusCodeKey = otelkey.New("status.code")
39+
StatusMessageKey = otelkey.New("status.message")
40+
ErrorKey = otelkey.New("error")
41+
NameKey = otelkey.New("name")
4142
)
4243

4344
type MockContextKeyValue struct {
@@ -220,8 +221,8 @@ func (s *MockSpan) IsRecording() bool {
220221
return s.recording
221222
}
222223

223-
func (s *MockSpan) SetStatus(status codes.Code) {
224-
s.SetAttributes(NameKey.Uint32(uint32(status)))
224+
func (s *MockSpan) SetStatus(code codes.Code, msg string) {
225+
s.SetAttributes(StatusCodeKey.Uint32(uint32(code)), StatusMessageKey.String(msg))
225226
}
226227

227228
func (s *MockSpan) SetName(name string) {
@@ -279,8 +280,8 @@ func (s *MockSpan) RecordError(ctx context.Context, err error, opts ...oteltrace
279280
cfg.Timestamp = time.Now()
280281
}
281282

282-
if cfg.Status != codes.OK {
283-
s.SetStatus(cfg.Status)
283+
if cfg.StatusCode != codes.OK {
284+
s.SetStatus(cfg.StatusCode, "")
284285
}
285286

286287
s.AddEventWithTimestamp(ctx, cfg.Timestamp, "error",

‎example/grpc/middleware/tracing/tracing.go

+1-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"go.opentelemetry.io/otel/plugin/grpctrace"
2323

2424
"google.golang.org/grpc"
25-
"google.golang.org/grpc/codes"
2625
"google.golang.org/grpc/metadata"
2726
"google.golang.org/grpc/status"
2827

@@ -81,8 +80,6 @@ func UnaryClientInterceptor(ctx context.Context, method string, req, reply inter
8180
func setTraceStatus(ctx context.Context, err error) {
8281
if err != nil {
8382
s, _ := status.FromError(err)
84-
trace.SpanFromContext(ctx).SetStatus(s.Code())
85-
} else {
86-
trace.SpanFromContext(ctx).SetStatus(codes.OK)
83+
trace.SpanFromContext(ctx).SetStatus(s.Code(), s.Message())
8784
}
8885
}

‎example/http/client/client.go

-4
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,9 @@ import (
2323
"net/http"
2424
"time"
2525

26-
"google.golang.org/grpc/codes"
27-
2826
"go.opentelemetry.io/otel/api/correlation"
2927
"go.opentelemetry.io/otel/api/global"
3028
"go.opentelemetry.io/otel/api/key"
31-
"go.opentelemetry.io/otel/api/trace"
3229
"go.opentelemetry.io/otel/exporters/trace/stdout"
3330
"go.opentelemetry.io/otel/plugin/httptrace"
3431
sdktrace "go.opentelemetry.io/otel/sdk/trace"
@@ -77,7 +74,6 @@ func main() {
7774
}
7875
body, err = ioutil.ReadAll(res.Body)
7976
_ = res.Body.Close()
80-
trace.SpanFromContext(ctx).SetStatus(codes.OK)
8177

8278
return err
8379
})

‎example/http/go.mod

+1-4
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,4 @@ go 1.13
44

55
replace go.opentelemetry.io/otel => ../..
66

7-
require (
8-
go.opentelemetry.io/otel v0.2.3
9-
google.golang.org/grpc v1.27.1
10-
)
7+
require go.opentelemetry.io/otel v0.2.3

‎exporters/otlp/transform_spans.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func otSpanToProtoSpan(sd *export.SpanData) *tracepb.Span {
3737
TraceId: sd.SpanContext.TraceID[:],
3838
SpanId: sd.SpanContext.SpanID[:],
3939
ParentSpanId: sd.ParentSpanID[:],
40-
Status: otStatusToProtoStatus(sd.Status),
40+
Status: otStatusToProtoStatus(sd.StatusCode, sd.StatusMessage),
4141
StartTimeUnixnano: uint64(sd.StartTime.Nanosecond()),
4242
EndTimeUnixnano: uint64(sd.EndTime.Nanosecond()),
4343
Links: otLinksToProtoLinks(sd.Links),
@@ -52,10 +52,10 @@ func otSpanToProtoSpan(sd *export.SpanData) *tracepb.Span {
5252
}
5353
}
5454

55-
func otStatusToProtoStatus(status codes.Code) *tracepb.Status {
55+
func otStatusToProtoStatus(status codes.Code, message string) *tracepb.Status {
5656
return &tracepb.Status{
57-
Code: tracepb.Status_StatusCode(status),
58-
// TODO (rghetia) : Add Status Message: when supported.
57+
Code: tracepb.Status_StatusCode(status),
58+
Message: message,
5959
}
6060
}
6161

‎exporters/otlp/transform_spans_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,8 @@ func TestOtSpanToOtlpSpan_Basic(t *testing.T) {
9191
},
9292
},
9393
},
94-
Status: codes.Internal,
94+
StatusCode: codes.Internal,
95+
StatusMessage: "utterly unrecognized",
9596
HasRemoteParent: true,
9697
Attributes: []core.KeyValue{
9798
core.Key("timeout_ns").Int64(12e9),
@@ -109,7 +110,8 @@ func TestOtSpanToOtlpSpan_Basic(t *testing.T) {
109110
StartTimeUnixnano: uint64(startTime.Nanosecond()),
110111
EndTimeUnixnano: uint64(endTime.Nanosecond()),
111112
Status: &tracepb.Status{
112-
Code: 13,
113+
Code: 13,
114+
Message: "utterly unrecognized",
113115
},
114116
Events: []*tracepb.Span_Event{
115117
{

‎exporters/trace/jaeger/jaeger.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ func spanDataToThrift(data *export.SpanData) *gen.Span {
157157
}
158158
}
159159

160-
tags = append(tags, getInt64Tag("status.code", int64(data.Status)),
161-
getStringTag("status.message", data.Status.String()),
160+
tags = append(tags,
161+
getInt64Tag("status.code", int64(data.StatusCode)),
162+
getStringTag("status.message", data.StatusMessage),
162163
getStringTag("span.kind", data.SpanKind.String()),
163164
)
164165

165166
// Ensure that if Status.Code is not OK, that we set the "error" tag on the Jaeger span.
166167
// See Issue https://github.com/census-instrumentation/opencensus-go/issues/1041
167-
if data.Status != codes.OK {
168+
if data.StatusCode != codes.OK {
168169
tags = append(tags, getBoolTag("error", true))
169170
}
170171

‎exporters/trace/jaeger/jaeger_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func Test_spanDataToThrift(t *testing.T) {
157157
statusCodeValue := int64(2)
158158
doubleValue := 123.456
159159
boolTrue := true
160-
statusMessage := "Unknown"
160+
statusMessage := "this is a problem"
161161
spanKind := "client"
162162

163163
tests := []struct {
@@ -192,8 +192,9 @@ func Test_spanDataToThrift(t *testing.T) {
192192
MessageEvents: []export.Event{
193193
{Name: eventNameValue, Attributes: []core.KeyValue{key.String("k1", keyValue)}, Time: now},
194194
},
195-
Status: codes.Unknown,
196-
SpanKind: apitrace.SpanKindClient,
195+
StatusCode: codes.Unknown,
196+
StatusMessage: statusMessage,
197+
SpanKind: apitrace.SpanKindClient,
197198
},
198199
want: &gen.Span{
199200
TraceIdLow: 651345242494996240,

‎exporters/trace/stdout/stdout_test.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,9 @@ func TestExporter_ExportSpan(t *testing.T) {
6060
{Name: "foo", Attributes: []core.KeyValue{key.String("key", keyValue)}, Time: now},
6161
{Name: "bar", Attributes: []core.KeyValue{key.Float64("double", doubleValue)}, Time: now},
6262
},
63-
SpanKind: trace.SpanKindInternal,
64-
Status: codes.Unknown,
63+
SpanKind: trace.SpanKindInternal,
64+
StatusCode: codes.Unknown,
65+
StatusMessage: "interesting",
6566
}
6667
ex.ExportSpan(context.Background(), testSpan)
6768

@@ -109,7 +110,8 @@ func TestExporter_ExportSpan(t *testing.T) {
109110
`}` +
110111
`],` +
111112
`"Links":null,` +
112-
`"Status":2,` +
113+
`"StatusCode":2,` +
114+
`"StatusMessage":"interesting",` +
113115
`"HasRemoteParent":false,` +
114116
`"DroppedAttributeCount":0,` +
115117
`"DroppedMessageEventCount":0,` +

‎internal/trace/mock_span.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (ms *MockSpan) IsRecording() bool {
4747
}
4848

4949
// SetStatus does nothing.
50-
func (ms *MockSpan) SetStatus(status codes.Code) {
50+
func (ms *MockSpan) SetStatus(status codes.Code, msg string) {
5151
}
5252

5353
// SetError does nothing.

‎plugin/httptrace/clienttrace.go

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ var (
3535
HTTPHeaderMIME = key.New("http.mime")
3636
HTTPRemoteAddr = key.New("http.remote")
3737
HTTPLocalAddr = key.New("http.local")
38-
MessageKey = key.New("message")
3938
)
4039

4140
type clientTracer struct {
@@ -97,8 +96,7 @@ func (ct *clientTracer) end(hook string, err error, attrs ...core.KeyValue) {
9796
defer ct.mtx.Unlock()
9897
if span, ok := ct.activeHooks[hook]; ok {
9998
if err != nil {
100-
span.SetStatus(codes.Unknown)
101-
span.SetAttributes(MessageKey.String(err.Error()))
99+
span.SetStatus(codes.Unknown, err.Error())
102100
}
103101
span.SetAttributes(attrs...)
104102
span.End()
@@ -172,8 +170,7 @@ func (ct *clientTracer) wroteHeaders() {
172170

173171
func (ct *clientTracer) wroteRequest(info httptrace.WroteRequestInfo) {
174172
if info.Err != nil {
175-
ct.root.SetAttributes(MessageKey.String(info.Err.Error()))
176-
ct.root.SetStatus(codes.Unknown)
173+
ct.root.SetStatus(codes.Unknown, info.Err.Error())
177174
}
178175
ct.end("http.send", info.Err)
179176
}

‎sdk/export/trace/trace.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ type SpanData struct {
5858
Attributes []core.KeyValue
5959
MessageEvents []Event
6060
Links []apitrace.Link
61-
Status codes.Code
61+
StatusCode codes.Code
62+
StatusMessage string
6263
HasRemoteParent bool
6364
DroppedAttributeCount int
6465
DroppedMessageEventCount int

‎sdk/trace/span.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,16 @@ func (s *span) IsRecording() bool {
8080
return s.data != nil
8181
}
8282

83-
func (s *span) SetStatus(status codes.Code) {
83+
func (s *span) SetStatus(code codes.Code, msg string) {
8484
if s == nil {
8585
return
8686
}
8787
if !s.IsRecording() {
8888
return
8989
}
9090
s.mu.Lock()
91-
s.data.Status = status
91+
s.data.StatusCode = code
92+
s.data.StatusMessage = msg
9293
s.mu.Unlock()
9394
}
9495

@@ -150,8 +151,8 @@ func (s *span) RecordError(ctx context.Context, err error, opts ...apitrace.Erro
150151
cfg.Timestamp = time.Now()
151152
}
152153

153-
if cfg.Status != codes.OK {
154-
s.SetStatus(cfg.Status)
154+
if cfg.StatusCode != codes.OK {
155+
s.SetStatus(cfg.StatusCode, "")
155156
}
156157

157158
errType := reflect.TypeOf(err)

‎sdk/trace/trace_test.go

+7-4
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ func TestSetSpanStatus(t *testing.T) {
559559
tp, _ := NewProvider(WithSyncer(te))
560560

561561
span := startSpan(tp, "SpanStatus")
562-
span.SetStatus(codes.Canceled)
562+
span.SetStatus(codes.Canceled, "canceled")
563563
got, err := endSpan(te, span)
564564
if err != nil {
565565
t.Fatal(err)
@@ -573,7 +573,8 @@ func TestSetSpanStatus(t *testing.T) {
573573
ParentSpanID: sid,
574574
Name: "span0",
575575
SpanKind: apitrace.SpanKindInternal,
576-
Status: codes.Canceled,
576+
StatusCode: codes.Canceled,
577+
StatusMessage: "canceled",
577578
HasRemoteParent: true,
578579
}
579580
if diff := cmpDiff(got, want); diff != "" {
@@ -957,7 +958,8 @@ func TestRecordErrorWithStatus(t *testing.T) {
957958
ParentSpanID: sid,
958959
Name: "span0",
959960
SpanKind: apitrace.SpanKindInternal,
960-
Status: codes.Unknown,
961+
StatusCode: codes.Unknown,
962+
StatusMessage: "",
961963
HasRemoteParent: true,
962964
MessageEvents: []export.Event{
963965
{
@@ -996,7 +998,8 @@ func TestRecordErrorNil(t *testing.T) {
996998
Name: "span0",
997999
SpanKind: apitrace.SpanKindInternal,
9981000
HasRemoteParent: true,
999-
Status: codes.OK,
1001+
StatusCode: codes.OK,
1002+
StatusMessage: "",
10001003
}
10011004
if diff := cmpDiff(got, want); diff != "" {
10021005
t.Errorf("SpanErrorOptions: -got +want %s", diff)

0 commit comments

Comments
 (0)
Please sign in to comment.