diff --git a/pkg/distributor/otel.go b/pkg/distributor/otel.go index 725d68c2b59..44d8e0957a7 100644 --- a/pkg/distributor/otel.go +++ b/pkg/distributor/otel.go @@ -118,7 +118,7 @@ func OTLPHandler( reader = http.MaxBytesReader(nil, reader, int64(maxRecvMsgSize)) if _, err := buf.ReadFrom(reader); err != nil { if util.IsRequestBodyTooLarge(err) { - return exportReq, 0, httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{ + return exportReq, 0, httpgrpc.Error(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{ actual: -1, limit: maxRecvMsgSize, }.Error()) @@ -137,7 +137,7 @@ func OTLPHandler( // Check the request size against the message size limit, regardless of whether the request is compressed. // If the request is compressed and its compressed length already exceeds the size limit, there's no need to decompress it. if r.ContentLength > int64(maxRecvMsgSize) { - return httpgrpc.Errorf(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{ + return httpgrpc.Error(http.StatusRequestEntityTooLarge, distributorMaxOTLPRequestSizeErr{ actual: int(r.ContentLength), limit: maxRecvMsgSize, }.Error())