You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-07-15 01:04:25 +02:00
Add Status type to SDK (#1874)
Add Status type to SDK Use this type to encapsulate the Span status similar to the Event type encapsulating a Span event and the Link type a span link. Co-authored-by: Anthony Mirabella <a9@aneurysm9.com>
This commit is contained in:
@ -64,10 +64,12 @@ func TestExporter_ExportSpan(t *testing.T) {
|
||||
{Name: "foo", Attributes: []attribute.KeyValue{attribute.String("key", keyValue)}, Time: now},
|
||||
{Name: "bar", Attributes: []attribute.KeyValue{attribute.Float64("double", doubleValue)}, Time: now},
|
||||
},
|
||||
SpanKind: trace.SpanKindInternal,
|
||||
StatusCode: codes.Error,
|
||||
StatusMessage: "interesting",
|
||||
Resource: resource,
|
||||
SpanKind: trace.SpanKindInternal,
|
||||
Status: tracesdk.Status{
|
||||
Code: codes.Error,
|
||||
Description: "interesting",
|
||||
},
|
||||
Resource: resource,
|
||||
}
|
||||
if err := ex.ExportSpans(context.Background(), []*tracesdk.SpanSnapshot{testSpan}); err != nil {
|
||||
t.Fatal(err)
|
||||
@ -129,8 +131,7 @@ func TestExporter_ExportSpan(t *testing.T) {
|
||||
`}` +
|
||||
`],` +
|
||||
`"Links":null,` +
|
||||
`"StatusCode":"Error",` +
|
||||
`"StatusMessage":"interesting",` +
|
||||
`"Status":{"Code":"Error","Description":"interesting"},` +
|
||||
`"DroppedAttributeCount":0,` +
|
||||
`"DroppedMessageEventCount":0,` +
|
||||
`"DroppedLinkCount":0,` +
|
||||
|
Reference in New Issue
Block a user