1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2024-11-18 16:31:44 +02:00

set trace status to Error

This commit is contained in:
Grandmax 2024-11-15 12:07:24 +01:00
parent 380b6d1066
commit e3ca6199c7

View File

@ -25,6 +25,7 @@ import (
"go.opentelemetry.io/contrib/propagators/aws/xray"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetricgrpc"
"go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace"
@ -483,7 +484,7 @@ func SendError(ctx context.Context, errType string, err error) {
attributes = append(attributes, semconv.ExceptionStacktraceKey.String(stack))
}
}
span.SetStatus(codes.Error, err.Error())
span.AddEvent(semconv.ExceptionEventName, trace.WithAttributes(attributes...))
}