diff --git a/CHANGELOG.md b/CHANGELOG.md index fff63767cd2..3a7ca25e626 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -121,6 +121,8 @@ Main (unreleased) * The carriage return symbol in Windows log files with CLRF endings will no longer be part of the log line. * These bugs used to cause some logs to show up with Chinese characters. Notably, this would happen on MSSQL UTF-16 LE logs. +- Fix the `loki.write` endpoint block's `enable_http2` attribute to actually affect the client. HTTP2 was previously disabled regardless of configuration. (@dehaansa) + v1.11.3 ----------------- diff --git a/internal/component/common/loki/client/client_test.go b/internal/component/common/loki/client/client_test.go index 32548d5cf41..fe0cf999643 100644 --- a/internal/component/common/loki/client/client_test.go +++ b/internal/component/common/loki/client/client_test.go @@ -429,7 +429,7 @@ func TestClient_Handle(t *testing.T) { BatchWait: testData.clientBatchWait, BatchSize: testData.clientBatchSize, DropRateLimitedBatches: testData.clientDropRateLimited, - Client: config.HTTPClientConfig{}, + Client: config.DefaultHTTPClientConfig, BackoffConfig: backoff.Config{MinBackoff: 1 * time.Millisecond, MaxBackoff: 2 * time.Millisecond, MaxRetries: testData.clientMaxRetries}, Timeout: 1 * time.Second, TenantID: testData.clientTenantID, @@ -569,7 +569,7 @@ func TestClient_StopNow(t *testing.T) { URL: serverURL, BatchWait: c.clientBatchWait, BatchSize: c.clientBatchSize, - Client: config.HTTPClientConfig{}, + Client: config.DefaultHTTPClientConfig, BackoffConfig: backoff.Config{MinBackoff: 5 * time.Second, MaxBackoff: 10 * time.Second, MaxRetries: c.clientMaxRetries}, Timeout: 1 * time.Second, TenantID: c.clientTenantID, diff --git a/internal/component/common/loki/client/queue_client.go b/internal/component/common/loki/client/queue_client.go index 1fd28d0af57..63b2aca09e4 100644 --- a/internal/component/common/loki/client/queue_client.go +++ b/internal/component/common/loki/client/queue_client.go @@ -217,7 +217,7 @@ func newQueueClient(metrics *Metrics, qcMetrics *QueueClientMetrics, cfg Config, return nil, err } - c.client, err = config.NewClientFromConfig(cfg.Client, useragent.ProductName, config.WithHTTP2Disabled()) + c.client, err = config.NewClientFromConfig(cfg.Client, useragent.ProductName) if err != nil { return nil, err } diff --git a/internal/component/common/loki/client/queue_client_test.go b/internal/component/common/loki/client/queue_client_test.go index ae71fb63a43..f8d1d58238f 100644 --- a/internal/component/common/loki/client/queue_client_test.go +++ b/internal/component/common/loki/client/queue_client_test.go @@ -124,7 +124,7 @@ func TestQueueClient(t *testing.T) { URL: serverURL, BatchWait: tc.batchWait, BatchSize: tc.batchSize, - Client: config.HTTPClientConfig{}, + Client: config.DefaultHTTPClientConfig, BackoffConfig: backoff.Config{MinBackoff: 5 * time.Second, MaxBackoff: 10 * time.Second, MaxRetries: 1}, Timeout: 1 * time.Second, TenantID: "", @@ -264,7 +264,7 @@ func runQueueClientBenchCase(b *testing.B, bc testCase, mhFactory func(t *testin URL: serverURL, BatchWait: time.Millisecond * 50, BatchSize: 10, - Client: config.HTTPClientConfig{}, + Client: config.DefaultHTTPClientConfig, BackoffConfig: backoff.Config{MinBackoff: 5 * time.Second, MaxBackoff: 10 * time.Second, MaxRetries: 1}, Timeout: 1 * time.Second, TenantID: "", @@ -357,7 +357,7 @@ func runRegularClientBenchCase(b *testing.B, bc testCase) { URL: serverURL, BatchWait: time.Millisecond * 50, BatchSize: 10, - Client: config.HTTPClientConfig{}, + Client: config.DefaultHTTPClientConfig, BackoffConfig: backoff.Config{MinBackoff: 5 * time.Second, MaxBackoff: 10 * time.Second, MaxRetries: 1}, Timeout: 1 * time.Second, TenantID: "", diff --git a/internal/loki/client/client.go b/internal/loki/client/client.go index ccf62709fa6..7c9fb1fb4ec 100644 --- a/internal/loki/client/client.go +++ b/internal/loki/client/client.go @@ -61,7 +61,7 @@ func New(logger log.Logger, cfg Config, timingHistogram *prometheus.HistogramVec if err != nil { return nil, err } - client, err := config.NewClientFromConfig(cfg.HTTPClientConfig, useragent.ProductName, config.WithHTTP2Disabled()) + client, err := config.NewClientFromConfig(cfg.HTTPClientConfig, useragent.ProductName) if err != nil { return nil, err }