Skip to content

Commit

Permalink
fix/condition for parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
bmiguel-teixeira committed Nov 26, 2024
1 parent cdf015d commit 6cadd28
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion exporter/prometheusremotewriteexporter/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ var _ component.Config = (*Config)(nil)

// Validate checks if the exporter configuration is valid
func (cfg *Config) Validate() error {
if cfg.MaxBatchRequestParallelism <= 1 {
if cfg.MaxBatchRequestParallelism < 1 {
return fmt.Errorf("max_batch_request_parallelism can't be set to below 1")
}

Expand Down
6 changes: 5 additions & 1 deletion exporter/prometheusremotewriteexporter/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func createDefaultConfig() component.Config {
clientConfig.WriteBufferSize = 512 * 1024
clientConfig.Timeout = exporterhelper.NewDefaultTimeoutConfig().Timeout

numConsumers := 5
if enableMultipleWorkersFeatureGate.IsEnabled() {
numConsumers = 1
}
return &Config{
Namespace: "",
ExternalLabels: map[string]string{},
Expand All @@ -102,7 +106,7 @@ func createDefaultConfig() component.Config {
RemoteWriteQueue: RemoteWriteQueue{
Enabled: true,
QueueSize: 10000,
NumConsumers: 5,
NumConsumers: numConsumers,
},
TargetInfo: &TargetInfo{
Enabled: true,
Expand Down

0 comments on commit 6cadd28

Please sign in to comment.