Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions internal/component/loki/write/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func GetDefaultEndpointOptions() EndpointOptions {
MaxBackoffRetries: 10,
HTTPClientConfig: types.CloneDefaultHTTPClientConfig(),
RetryOnHTTP429: true,
QueueConfig: defaultQueueConfig,
}

return defaultEndpointOptions
Expand Down
16 changes: 16 additions & 0 deletions internal/component/loki/write/write_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,22 @@ func testMultipleEndpoint(t *testing.T, alterArgs func(arguments *Arguments)) {
}

func TestComponentExperimentalConfig(t *testing.T) {
t.Run("should be able to create component with default queue_config", func(t *testing.T) {
var args Arguments
err := syntax.Unmarshal([]byte(`
endpoint {
url = "test.com"
}
`), &args)
require.NoError(t, err)

_, err = New(component.Options{
MinStability: featuregate.StabilityGenerallyAvailable,
OnStateChange: func(e component.Exports) {},
}, args)
require.NoError(t, err)
})

t.Run("should not be able to create component with experimental config without correct flag", func(t *testing.T) {
var args Arguments
err := syntax.Unmarshal([]byte(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func toLokiWriteArguments(config *client.Config, diags *diag.Diagnostics) *lokiw
RemoteTimeout: config.Timeout,
TenantID: config.TenantID,
RetryOnHTTP429: !config.DropRateLimitedBatches,
QueueConfig: lokiwrite.GetDefaultEndpointOptions().QueueConfig,
},
},
ExternalLabels: convertFlagLabels(config.ExternalLabels),
Expand Down
Loading