Skip to content

Commit

Permalink
Set root span status to error too
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <[email protected]>
  • Loading branch information
yurishkuro committed Jul 2, 2024
1 parent 4cb1e4c commit f06bf84
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions model/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/yurishkuro/microsim/tracing"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/propagation"
"go.opentelemetry.io/otel/trace"
)
Expand Down Expand Up @@ -124,6 +125,7 @@ func (c *Config) runTest(tracerProvider trace.TracerProvider) {
err := endpoint.Call(ctx, tracerProvider)
if err != nil {
rootSpan.RecordError(err)
rootSpan.SetStatus(codes.Error, err.Error())
}
if c.SleepBetweenRequests != 0 {
time.Sleep(c.SleepBetweenRequests)
Expand Down

0 comments on commit f06bf84

Please sign in to comment.