-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
When an export fails with a partial success, the error is passed to the otel.ErrorHandler instead of returned to the user with the error returned with the function:
opentelemetry-go/exporters/otlp/otlptrace/otlptracegrpc/client.go
Lines 196 to 203 in 1298533
| if resp != nil && resp.PartialSuccess != nil { | |
| msg := resp.PartialSuccess.GetErrorMessage() | |
| n := resp.PartialSuccess.GetRejectedSpans() | |
| if n != 0 || msg != "" { | |
| err := internal.TracePartialSuccessError(n, msg) | |
| otel.Handle(err) | |
| } | |
| } |
opentelemetry-go/exporters/otlp/otlptrace/otlptracehttp/client.go
Lines 190 to 196 in 1298533
| if respProto.PartialSuccess != nil { | |
| msg := respProto.PartialSuccess.GetErrorMessage() | |
| n := respProto.PartialSuccess.GetRejectedSpans() | |
| if n != 0 || msg != "" { | |
| err := internal.TracePartialSuccessError(n, msg) | |
| otel.Handle(err) | |
| } |
opentelemetry-go/exporters/otlp/otlpmetric/otlpmetricgrpc/client.go
Lines 123 to 129 in 1298533
| if resp != nil && resp.PartialSuccess != nil { | |
| msg := resp.PartialSuccess.GetErrorMessage() | |
| n := resp.PartialSuccess.GetRejectedDataPoints() | |
| if n != 0 || msg != "" { | |
| err := internal.MetricPartialSuccessError(n, msg) | |
| otel.Handle(err) | |
| } |
opentelemetry-go/exporters/otlp/otlpmetric/otlpmetrichttp/client.go
Lines 184 to 191 in 1298533
| if respProto.PartialSuccess != nil { | |
| msg := respProto.PartialSuccess.GetErrorMessage() | |
| n := respProto.PartialSuccess.GetRejectedDataPoints() | |
| if n != 0 || msg != "" { | |
| err := internal.MetricPartialSuccessError(n, msg) | |
| otel.Handle(err) | |
| } | |
| } |
opentelemetry-go/exporters/otlp/otlplog/otlploggrpc/client.go
Lines 139 to 145 in 1298533
| if resp != nil && resp.PartialSuccess != nil { | |
| msg := resp.PartialSuccess.GetErrorMessage() | |
| n := resp.PartialSuccess.GetRejectedLogRecords() | |
| if n != 0 || msg != "" { | |
| err := fmt.Errorf("OTLP partial success: %s (%d log records rejected)", msg, n) | |
| otel.Handle(err) | |
| } |
opentelemetry-go/exporters/otlp/otlplog/otlploghttp/client.go
Lines 180 to 186 in 1298533
| if respProto.PartialSuccess != nil { | |
| msg := respProto.PartialSuccess.GetErrorMessage() | |
| n := respProto.PartialSuccess.GetRejectedLogRecords() | |
| if n != 0 || msg != "" { | |
| err := fmt.Errorf("OTLP partial success: %s (%d log records rejected)", msg, n) | |
| otel.Handle(err) | |
| } |
The error cannot be returned in the anonymous function that is being called by the requestFunc that handles retries (this is not retryable), but the code should be restructured to ensure the caller receives this error so they do not mistakenly think things were successful.