mirror of
https://github.com/imgproxy/imgproxy.git
synced 2024-11-18 16:31:44 +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:
commit
f0276f3cc0
@ -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...))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user