Skip to content

Commit f06bf84

Browse files
committed
Set root span status to error too
Signed-off-by: Yuri Shkuro <[email protected]>
1 parent 4cb1e4c commit f06bf84

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

model/config.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"github.com/yurishkuro/microsim/tracing"
1111
"go.opentelemetry.io/otel"
1212
"go.opentelemetry.io/otel/attribute"
13+
"go.opentelemetry.io/otel/codes"
1314
"go.opentelemetry.io/otel/propagation"
1415
"go.opentelemetry.io/otel/trace"
1516
)
@@ -124,6 +125,7 @@ func (c *Config) runTest(tracerProvider trace.TracerProvider) {
124125
err := endpoint.Call(ctx, tracerProvider)
125126
if err != nil {
126127
rootSpan.RecordError(err)
128+
rootSpan.SetStatus(codes.Error, err.Error())
127129
}
128130
if c.SleepBetweenRequests != 0 {
129131
time.Sleep(c.SleepBetweenRequests)

0 commit comments

Comments
 (0)