From 17261586aa2a46c9fb913e1f7b053e3f02b9f801 Mon Sep 17 00:00:00 2001 From: Pablo Baeyens Date: Thu, 5 Jan 2023 16:07:36 +0100 Subject: [PATCH] [pkg/trace/api] Remove usage of apiutil package --- pkg/trace/api/otlp.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/trace/api/otlp.go b/pkg/trace/api/otlp.go index d655962227359d..c4977d50710d05 100644 --- a/pkg/trace/api/otlp.go +++ b/pkg/trace/api/otlp.go @@ -21,7 +21,6 @@ import ( "github.com/DataDog/datadog-agent/pkg/otlp/model/attributes" "github.com/DataDog/datadog-agent/pkg/otlp/model/source" - "github.com/DataDog/datadog-agent/pkg/trace/api/apiutil" "github.com/DataDog/datadog-agent/pkg/trace/config" "github.com/DataDog/datadog-agent/pkg/trace/info" "github.com/DataDog/datadog-agent/pkg/trace/log" @@ -147,7 +146,7 @@ func (o *OTLPReceiver) ServeHTTP(w http.ResponseWriter, req *http.Request) { } r = gzipr } - rd := apiutil.NewLimitedReader(r, o.conf.OTLPReceiver.MaxRequestBytes) + rd := io.LimitReader(r, o.conf.OTLPReceiver.MaxRequestBytes) slurp, err := io.ReadAll(rd) if err != nil { http.Error(w, err.Error(), http.StatusBadRequest)