diff --git a/CHANGELOG.md b/CHANGELOG.md index 896cc8d89dd..bb7992ba3e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re - [#4792](https://github.com/thanos-io/thanos/pull/4792) Store: Fix data race in BucketedBytes pool. - [#4769](https://github.com/thanos-io/thanos/pull/4769) Query-frontend+api: add "X-Request-ID" field and other fields to start call log. - [#4918](https://github.com/thanos-io/thanos/pull/4918) Tracing: Fixing force tracing with Jaeger. +- [#4928](https://github.com/thanos-io/thanos/pull/4928) Azure: Only create an http client once, to conserve memory. ### Changed diff --git a/pkg/objstore/azure/helpers.go b/pkg/objstore/azure/helpers.go index ce245642414..0edd448adac 100644 --- a/pkg/objstore/azure/helpers.go +++ b/pkg/objstore/azure/helpers.go @@ -104,6 +104,10 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. retryOptions.TryTimeout = time.Until(deadline) } + client := http.Client{ + Transport: DefaultTransport(conf), + } + p := blob.NewPipeline(credentials, blob.PipelineOptions{ Retry: retryOptions, Telemetry: blob.TelemetryOptions{Value: "Thanos"}, @@ -117,10 +121,6 @@ func getContainerURL(ctx context.Context, logger log.Logger, conf Config) (blob. }, HTTPSender: pipeline.FactoryFunc(func(next pipeline.Policy, po *pipeline.PolicyOptions) pipeline.PolicyFunc { return func(ctx context.Context, request pipeline.Request) (pipeline.Response, error) { - client := http.Client{ - Transport: DefaultTransport(conf), - } - resp, err := client.Do(request.WithContext(ctx)) return pipeline.NewHTTPResponse(resp), err