Skip to content

Commit 710bbe7

Browse files
committed
Expose this option as queue_batch.Settings
1 parent 59895d3 commit 710bbe7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.chloggen/exporter-batcher-merge-context.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ change_type: enhancement
77
component: exporterhelper
88

99
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10-
note: Provide an interface `batchSettings.mergeCtx` so users can control how context values are preserved or combined
10+
note: Provide an interface `queue_batch.Setting.MergeCtx` so users can control how context values are preserved or combined
1111

1212
# One or more tracking issues or pull requests related to the change
1313
issues: [13320]

exporter/exporterhelper/internal/queuebatch/queue_batch.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ type Settings[T any] struct {
2323
ItemsSizer request.Sizer[T]
2424
BytesSizer request.Sizer[T]
2525
Partitioner Partitioner[T]
26+
MergeCtx func(context.Context, context.Context) context.Context
2627
}
2728

2829
type QueueBatch struct {
@@ -39,6 +40,7 @@ func NewQueueBatch(
3940
itemsSizer: set.ItemsSizer,
4041
bytesSizer: set.BytesSizer,
4142
partitioner: set.Partitioner,
43+
mergeCtx: set.MergeCtx,
4244
next: next,
4345
maxWorkers: cfg.NumConsumers,
4446
logger: set.Telemetry.Logger,

0 commit comments

Comments
 (0)