Skip to content

Commit 75403f2

Browse files
authored
[exporterhelper] Enable items and bytes sizers for persistent queue (#13340)
Fixes #12881 Signed-off-by: Bogdan Drutu <[email protected]>
1 parent e2954b9 commit 75403f2

File tree

3 files changed

+25
-15
lines changed

3 files changed

+25
-15
lines changed

.chloggen/enable-sizer.yaml

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 items and bytes sizers for persistent queue
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [12881]
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/queuebatch/config.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,6 @@ func (cfg *Config) Validate() error {
6666
return errors.New("`wait_for_result` is not supported with a persistent queue configured with `storage`")
6767
}
6868

69-
// Only support request sizer for persistent queue at this moment.
70-
if cfg.StorageID != nil && cfg.Sizer != request.SizerTypeRequests {
71-
return errors.New("persistent queue configured with `storage` only supports `requests` sizer")
72-
}
73-
7469
if cfg.Batch != nil {
7570
// Only support items or bytes sizer for batch at this moment.
7671
if cfg.Sizer != request.SizerTypeItems && cfg.Sizer != request.SizerTypeBytes {

exporter/exporterhelper/internal/queuebatch/config_test.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ func TestConfig_Validate(t *testing.T) {
3535
cfg.StorageID = &storageID
3636
require.EqualError(t, cfg.Validate(), "`wait_for_result` is not supported with a persistent queue configured with `storage`")
3737

38-
cfg = newTestConfig()
39-
cfg.Sizer = request.SizerTypeBytes
40-
cfg.StorageID = &storageID
41-
require.EqualError(t, cfg.Validate(), "persistent queue configured with `storage` only supports `requests` sizer")
42-
43-
cfg = newTestConfig()
44-
cfg.Sizer = request.SizerTypeItems
45-
cfg.StorageID = &storageID
46-
require.EqualError(t, cfg.Validate(), "persistent queue configured with `storage` only supports `requests` sizer")
47-
4838
cfg = newTestConfig()
4939
cfg.Sizer = request.SizerTypeRequests
5040
require.EqualError(t, cfg.Validate(), "`batch` supports only `items` or `bytes` sizer")

0 commit comments

Comments
 (0)