Skip to content

Commit 94eb3df

Browse files
authored
Enable the new pull-based batcher in exporterhelper (#12291)
Signed-off-by: Bogdan Drutu <[email protected]>
1 parent 0294890 commit 94eb3df

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Use this changelog template to create an entry for release notes.
2+
3+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4+
change_type: enhancement
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: exporterhelper
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: Enable the new pull-based batcher in exporterhelper
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12291]
14+
15+
# (Optional) One or more lines of additional information to render under the primary note.
16+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17+
# Use pipe (|) for multiline entries.
18+
subtext:
19+
20+
# Optional: The change log or logs in which this entry should be included.
21+
# e.g. '[user]' or '[user, api]'
22+
# Include 'user' if the change is relevant to end users.
23+
# Include 'api' if there is a change to a library API.
24+
# Default: '[user]'
25+
change_logs: [user]

exporter/exporterhelper/internal/batch_sender_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,14 @@ func TestBatchSender_ConcurrencyLimitReached(t *testing.T) {
376376
expectedItems: 51,
377377
},
378378
}
379+
380+
// Why do we not expect the same behavior when usePullingBasedExporterQueueBatcher is true?
381+
// This test checks that when concurrency limit of batch_sender is reached, the batch_sender will flush immediately.
382+
// To avoid blocking, the concurrency limit is set to the number of concurrent goroutines that are in charge of
383+
// reading from the queue and adding to batch. With the new model, we are pulling instead of pushing so we don't
384+
// block the reading goroutine anymore.
385+
defer setFeatureGateForTest(t, usePullingBasedExporterQueueBatcher, false)()
386+
379387
for _, tt := range tests {
380388
t.Run(tt.name, func(t *testing.T) {
381389
qCfg := exporterqueue.NewDefaultConfig()

exporter/exporterhelper/internal/queue_sender.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import (
1919

2020
var usePullingBasedExporterQueueBatcher = featuregate.GlobalRegistry().MustRegister(
2121
"exporter.UsePullingBasedExporterQueueBatcher",
22-
featuregate.StageAlpha,
22+
featuregate.StageBeta,
2323
featuregate.WithRegisterFromVersion("v0.115.0"),
2424
featuregate.WithRegisterDescription("if set to true, turns on the pulling-based exporter queue bathcer"),
2525
)

0 commit comments

Comments
 (0)