@@ -19,8 +19,8 @@ import (
19
19
"go.opentelemetry.io/collector/consumer"
20
20
"go.opentelemetry.io/collector/exporter"
21
21
"go.opentelemetry.io/collector/exporter/exporterbatcher"
22
+ "go.opentelemetry.io/collector/exporter/exporterhelper/internal/request"
22
23
"go.opentelemetry.io/collector/exporter/exporterqueue" // BaseExporter contains common fields between different exporter types.
23
- "go.opentelemetry.io/collector/exporter/internal"
24
24
"go.opentelemetry.io/collector/pipeline"
25
25
)
26
26
@@ -31,8 +31,8 @@ type BaseExporter struct {
31
31
component.StartFunc
32
32
component.ShutdownFunc
33
33
34
- Marshaler exporterqueue.Marshaler [internal .Request ]
35
- Unmarshaler exporterqueue.Unmarshaler [internal .Request ]
34
+ Marshaler exporterqueue.Marshaler [request .Request ]
35
+ Unmarshaler exporterqueue.Unmarshaler [request .Request ]
36
36
37
37
Set exporter.Settings
38
38
@@ -42,17 +42,17 @@ type BaseExporter struct {
42
42
// Chain of senders that the exporter helper applies before passing the data to the actual exporter.
43
43
// The data is handled by each sender in the respective order starting from the queueSender.
44
44
// Most of the senders are optional, and initialized with a no-op path-through sender.
45
- QueueSender Sender [internal .Request ]
46
- ObsrepSender Sender [internal .Request ]
47
- RetrySender Sender [internal .Request ]
45
+ QueueSender Sender [request .Request ]
46
+ ObsrepSender Sender [request .Request ]
47
+ RetrySender Sender [request .Request ]
48
48
49
- firstSender Sender [internal .Request ]
49
+ firstSender Sender [request .Request ]
50
50
51
51
ConsumerOptions []consumer.Option
52
52
53
53
timeoutCfg TimeoutConfig
54
54
retryCfg configretry.BackOffConfig
55
- queueFactory exporterqueue.Factory [internal .Request ]
55
+ queueFactory exporterqueue.Factory [request .Request ]
56
56
queueCfg exporterqueue.Config
57
57
batcherCfg exporterbatcher.Config
58
58
}
@@ -61,7 +61,7 @@ func NewBaseExporter(set exporter.Settings, signal pipeline.Signal, options ...O
61
61
be := & BaseExporter {
62
62
Set : set ,
63
63
timeoutCfg : NewDefaultTimeoutConfig (),
64
- queueFactory : exporterqueue .NewMemoryQueueFactory [internal .Request ](),
64
+ queueFactory : exporterqueue .NewMemoryQueueFactory [request .Request ](),
65
65
}
66
66
67
67
for _ , op := range options {
@@ -105,7 +105,7 @@ func NewBaseExporter(set exporter.Settings, signal pipeline.Signal, options ...O
105
105
}
106
106
107
107
// Send sends the request using the first sender in the chain.
108
- func (be * BaseExporter ) Send (ctx context.Context , req internal .Request ) error {
108
+ func (be * BaseExporter ) Send (ctx context.Context , req request .Request ) error {
109
109
// Have to read the number of items before sending the request since the request can
110
110
// be modified by the downstream components like the batcher.
111
111
itemsCount := req .ItemsCount ()
@@ -206,7 +206,7 @@ func WithQueue(config QueueConfig) Option {
206
206
QueueSize : config .QueueSize ,
207
207
Blocking : config .Blocking ,
208
208
}
209
- o .queueFactory = exporterqueue .NewPersistentQueueFactory [internal .Request ](config .StorageID , exporterqueue.PersistentQueueSettings [internal .Request ]{
209
+ o .queueFactory = exporterqueue .NewPersistentQueueFactory [request .Request ](config .StorageID , exporterqueue.PersistentQueueSettings [request .Request ]{
210
210
Marshaler : o .Marshaler ,
211
211
Unmarshaler : o .Unmarshaler ,
212
212
})
@@ -218,7 +218,7 @@ func WithQueue(config QueueConfig) Option {
218
218
// This option should be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter.
219
219
// Experimental: This API is at the early stage of development and may change without backward compatibility
220
220
// until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
221
- func WithRequestQueue (cfg exporterqueue.Config , queueFactory exporterqueue.Factory [internal .Request ]) Option {
221
+ func WithRequestQueue (cfg exporterqueue.Config , queueFactory exporterqueue.Factory [request .Request ]) Option {
222
222
return func (o * BaseExporter ) error {
223
223
if o .Marshaler != nil || o .Unmarshaler != nil {
224
224
return errors .New ("WithRequestQueue option must be used with the new request exporters only, use WithQueue instead" )
@@ -257,7 +257,7 @@ func WithBatcher(cfg exporterbatcher.Config) Option {
257
257
258
258
// WithMarshaler is used to set the request marshaler for the new exporter helper.
259
259
// It must be provided as the first option when creating a new exporter helper.
260
- func WithMarshaler (marshaler exporterqueue.Marshaler [internal .Request ]) Option {
260
+ func WithMarshaler (marshaler exporterqueue.Marshaler [request .Request ]) Option {
261
261
return func (o * BaseExporter ) error {
262
262
o .Marshaler = marshaler
263
263
return nil
@@ -266,7 +266,7 @@ func WithMarshaler(marshaler exporterqueue.Marshaler[internal.Request]) Option {
266
266
267
267
// WithUnmarshaler is used to set the request unmarshaler for the new exporter helper.
268
268
// It must be provided as the first option when creating a new exporter helper.
269
- func WithUnmarshaler (unmarshaler exporterqueue.Unmarshaler [internal .Request ]) Option {
269
+ func WithUnmarshaler (unmarshaler exporterqueue.Unmarshaler [request .Request ]) Option {
270
270
return func (o * BaseExporter ) error {
271
271
o .Unmarshaler = unmarshaler
272
272
return nil
0 commit comments