Skip to content

Commit cb90fb5

Browse files
committed
[chore] Change QueueBatch implementation to use the final config
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 622ce90 commit cb90fb5

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

exporter/exporterhelper/internal/queue_sender.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ func newQueueBatchConfig(qCfg exporterqueue.Config, bCfg exporterbatcher.Config)
5151
QueueSize: qCfg.QueueSize,
5252
NumConsumers: qCfg.NumConsumers,
5353
BlockOnOverflow: qCfg.Blocking,
54+
<<<<<<< HEAD
5455
StorageID: qCfg.StorageID,
56+
=======
57+
>>>>>>> 918e0fb47 ([chore] Change QueueBatch implementation to use the final config)
5558
}
5659
if bCfg.Enabled {
5760
qbCfg.Batch = &queuebatch.BatchConfig{

exporter/exporterhelper/internal/queuebatch/config.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,27 @@ package queuebatch // import "go.opentelemetry.io/collector/exporter/exporterhel
55

66
import (
77
"errors"
8+
"runtime"
89
"time"
910

1011
"go.opentelemetry.io/collector/component"
1112
"go.opentelemetry.io/collector/exporter/exporterbatcher"
1213
)
1314

15+
func NewDefaultConfig() Config {
16+
return Config{
17+
Enabled: true,
18+
Sizer: exporterbatcher.SizerTypeItems,
19+
NumConsumers: runtime.NumCPU(),
20+
QueueSize: 100_000,
21+
BlockOnOverflow: true,
22+
Batch: &BatchConfig{
23+
FlushTimeout: 200 * time.Millisecond,
24+
MinSize: 2048,
25+
},
26+
}
27+
}
28+
1429
// Config defines configuration for queueing and batching incoming requests.
1530
type Config struct {
1631
// Enabled indicates whether to not enqueue and batch before exporting.

0 commit comments

Comments
 (0)