Skip to content

Commit 6f29b34

Browse files
authored
[exporter/debug] add queue configuration (#14101)
Fixes #14033 --------- Signed-off-by: alex boten <[email protected]>
1 parent 1847c2e commit 6f29b34

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
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: bug_fix
5+
6+
# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
7+
component: exporter/debug
8+
9+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10+
note: add queue configuration
11+
12+
# One or more tracking issues or pull requests related to the change
13+
issues: [14101]
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: []

exporter/debugexporter/exporter_test.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func TestMetricsNoErrors(t *testing.T) {
5858
func TestLogsNoErrors(t *testing.T) {
5959
for _, tc := range createTestCases() {
6060
t.Run(tc.name, func(t *testing.T) {
61-
lle, err := createLogs(context.Background(), exportertest.NewNopSettings(metadata.Type), createDefaultConfig())
61+
lle, err := createLogs(context.Background(), exportertest.NewNopSettings(metadata.Type), tc.config)
6262
require.NotNil(t, lle)
6363
assert.NoError(t, err)
6464

@@ -73,7 +73,7 @@ func TestLogsNoErrors(t *testing.T) {
7373
func TestProfilesNoErrors(t *testing.T) {
7474
for _, tc := range createTestCases() {
7575
t.Run(tc.name, func(t *testing.T) {
76-
lle, err := createProfiles(context.Background(), exportertest.NewNopSettings(metadata.Type), createDefaultConfig())
76+
lle, err := createProfiles(context.Background(), exportertest.NewNopSettings(metadata.Type), tc.config)
7777
require.NotNil(t, lle)
7878
assert.NoError(t, err)
7979

@@ -110,13 +110,16 @@ func createTestCases() []testCase {
110110
{
111111
name: "default config",
112112
config: func() *Config {
113-
return createDefaultConfig().(*Config)
113+
c := createDefaultConfig().(*Config)
114+
c.QueueConfig.QueueSize = 10
115+
return c
114116
}(),
115117
},
116118
{
117119
name: "don't use internal logger",
118120
config: func() *Config {
119121
cfg := createDefaultConfig().(*Config)
122+
cfg.QueueConfig.QueueSize = 10
120123
cfg.UseInternalLogger = false
121124
return cfg
122125
}(),

exporter/debugexporter/factory.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func createTraces(ctx context.Context, set exporter.Settings, config component.C
6161
return exporterhelper.NewTraces(ctx, set, config,
6262
debug.pushTraces,
6363
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
64+
exporterhelper.WithQueue(cfg.QueueConfig),
6465
exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}),
6566
exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)),
6667
)
@@ -73,6 +74,7 @@ func createMetrics(ctx context.Context, set exporter.Settings, config component.
7374
return exporterhelper.NewMetrics(ctx, set, config,
7475
debug.pushMetrics,
7576
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
77+
exporterhelper.WithQueue(cfg.QueueConfig),
7678
exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}),
7779
exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)),
7880
)
@@ -85,6 +87,7 @@ func createLogs(ctx context.Context, set exporter.Settings, config component.Con
8587
return exporterhelper.NewLogs(ctx, set, config,
8688
debug.pushLogs,
8789
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
90+
exporterhelper.WithQueue(cfg.QueueConfig),
8891
exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}),
8992
exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)),
9093
)
@@ -97,6 +100,7 @@ func createProfiles(ctx context.Context, set exporter.Settings, config component
97100
return xexporterhelper.NewProfiles(ctx, set, config,
98101
debug.pushProfiles,
99102
exporterhelper.WithCapabilities(consumer.Capabilities{MutatesData: false}),
103+
exporterhelper.WithQueue(cfg.QueueConfig),
100104
exporterhelper.WithTimeout(exporterhelper.TimeoutConfig{Timeout: 0}),
101105
exporterhelper.WithShutdown(otlptext.LoggerSync(exporterLogger)),
102106
)

0 commit comments

Comments
 (0)