mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-10-09 19:52:30 +02:00
Merge pull request #1379 from maxd-wttj/fix-trace-error
Set trace status to Error when using OTEL exporter
This commit is contained in:
@@ -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...))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user