summaryrefslogtreecommitdiff
path: root/client/httpclient.go
diff options
context:
space:
mode:
authorIgor Drozdov <idrozdov@gitlab.com>2023-02-06 05:34:18 +0100
committerIgor Drozdov <idrozdov@gitlab.com>2023-02-07 20:45:48 +0100
commit3a733910307284f8e5e33d63eadf521c74e146cf (patch)
tree739ddd279a356978eb9831a0372589e6bcd36b68 /client/httpclient.go
parent336c4a51aa332b0cc1c68798003a1d82ab4a9cc3 (diff)
downloadgitlab-shell-3a733910307284f8e5e33d63eadf521c74e146cf.tar.gz
Define Do function for Gitlab net client
In future, we'll need to perform http requests for Geo related code area. We cannot use retryable requests because: - It's not necessary for the to be retryable - In order to retry, the whole request body is stored in RAM, while we need to stream large blobs of data This commit: - Extracts logging into a separate round tripper in order to reuse it for other http requests by default - Defines Do function that accepts raw request as an argument
Diffstat (limited to 'client/httpclient.go')
-rw-r--r--client/httpclient.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/client/httpclient.go b/client/httpclient.go
index 9b57add..05ed4ef 100644
--- a/client/httpclient.go
+++ b/client/httpclient.go
@@ -14,8 +14,6 @@ import (
"time"
"github.com/hashicorp/go-retryablehttp"
- "gitlab.com/gitlab-org/labkit/correlation"
- "gitlab.com/gitlab-org/labkit/tracing"
)
const (
@@ -121,7 +119,7 @@ func NewHTTPClientWithOpts(gitlabURL, gitlabRelativeURLRoot, caFile, caPath stri
c.RetryWaitMax = hcc.retryWaitMax
c.RetryWaitMin = hcc.retryWaitMin
c.Logger = nil
- c.HTTPClient.Transport = correlation.NewInstrumentedRoundTripper(tracing.NewRoundTripper(transport))
+ c.HTTPClient.Transport = newTransport(transport)
c.HTTPClient.Timeout = readTimeout(readTimeoutSeconds)
client := &HttpClient{RetryableHTTP: c, Host: host}