Documentation
¶
Index ¶
- Constants
- func NewThrottleRetry(err error, delay time.Duration) error
- type BaseExporter
- type MockHost
- type Option
- func WithBatcher(cfg exporterbatcher.Config) Option
- func WithCapabilities(capabilities consumer.Capabilities) Option
- func WithEncoding(encoding exporterqueue.Encoding[request.Request]) Option
- func WithQueue(cfg exporterqueue.Config) Option
- func WithRequestQueue(cfg exporterqueue.Config, encoding exporterqueue.Encoding[request.Request]) Option
- func WithRetry(config configretry.BackOffConfig) Option
- func WithShutdown(shutdown component.ShutdownFunc) Option
- func WithStart(start component.StartFunc) Option
- func WithTimeout(timeoutConfig TimeoutConfig) Option
- type QueueSender
- type SendFunc
- type Sender
- type TimeoutConfig
Constants ¶
const ( // ExporterKey used to identify exporters in metrics and traces. ExporterKey = "exporter" // DataTypeKey used to identify the data type in the queue size metric. DataTypeKey = "data_type" // ItemsSent used to track number of items sent by exporters. ItemsSent = "items.sent" // ItemsFailed used to track number of items that failed to be sent by exporters. ItemsFailed = "items.failed" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseExporter ¶ added in v0.110.0
type BaseExporter struct { component.StartFunc component.ShutdownFunc Set exporter.Settings // Message for the user to be added with an export failure message. ExportFailureMessage string // Chain of senders that the exporter helper applies before passing the data to the actual exporter. // The data is handled by each sender in the respective order starting from the queueSender. // Most of the senders are optional, and initialized with a no-op path-through sender. QueueSender Sender[request.Request] RetrySender Sender[request.Request] ConsumerOptions []consumer.Option // contains filtered or unexported fields }
func NewBaseExporter ¶ added in v0.110.0
func (*BaseExporter) Send ¶ added in v0.110.0
Send sends the request using the first sender in the chain.
type Option ¶ added in v0.110.0
type Option func(*BaseExporter) error
Option apply changes to BaseExporter.
func WithBatcher ¶ added in v0.110.0
func WithBatcher(cfg exporterbatcher.Config) Option
WithBatcher enables batching for an exporter based on custom request types. For now, it can be used only with the New[Traces|Metrics|Logs]RequestExporter exporter helpers and WithRequestBatchFuncs provided. This API is at the early stage of development and may change without backward compatibility until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
func WithCapabilities ¶ added in v0.110.0
func WithCapabilities(capabilities consumer.Capabilities) Option
WithCapabilities overrides the default Capabilities() function for a Consumer. The default is non-mutable data. TODO: Verify if we can change the default to be mutable as we do for processors.
func WithEncoding ¶ added in v0.121.0
func WithEncoding(encoding exporterqueue.Encoding[request.Request]) Option
WithEncoding is used to set the request encoding for the new exporter helper. It must be provided as the first option when creating a new exporter helper.
func WithQueue ¶ added in v0.110.0
func WithQueue(cfg exporterqueue.Config) Option
WithQueue overrides the default QueueConfig for an exporter. The default QueueConfig is to disable queueing. This option cannot be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter.
func WithRequestQueue ¶ added in v0.110.0
func WithRequestQueue(cfg exporterqueue.Config, encoding exporterqueue.Encoding[request.Request]) Option
WithRequestQueue enables queueing for an exporter. This option should be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter. Experimental: This API is at the early stage of development and may change without backward compatibility until https://github.com/open-telemetry/opentelemetry-collector/issues/8122 is resolved.
func WithRetry ¶ added in v0.110.0
func WithRetry(config configretry.BackOffConfig) Option
WithRetry overrides the default configretry.BackOffConfig for an exporter. The default configretry.BackOffConfig is to disable retries.
func WithShutdown ¶ added in v0.110.0
func WithShutdown(shutdown component.ShutdownFunc) Option
WithShutdown overrides the default Shutdown function for an exporter. The default shutdown function does nothing and always returns nil.
func WithStart ¶ added in v0.110.0
WithStart overrides the default Start function for an exporter. The default start function does nothing and always returns nil.
func WithTimeout ¶ added in v0.110.0
func WithTimeout(timeoutConfig TimeoutConfig) Option
WithTimeout overrides the default TimeoutConfig for an exporter. The default TimeoutConfig is 5 seconds.
type QueueSender ¶ added in v0.110.0
type QueueSender struct {
// contains filtered or unexported fields
}
func NewQueueSender ¶ added in v0.110.0
func NewQueueSender( qSet exporterqueue.Settings[request.Request], qCfg exporterqueue.Config, bCfg exporterbatcher.Config, exportFailureMessage string, next Sender[request.Request], ) (*QueueSender, error)
func (*QueueSender) Send ¶ added in v0.110.0
Send implements the requestSender interface. It puts the request in the queue.
type TimeoutConfig ¶ added in v0.110.0
type TimeoutConfig struct { // Timeout is the timeout for every attempt to send data to the backend. // A zero timeout means no timeout. Timeout time.Duration `mapstructure:"timeout"` }
TimeoutConfig for timeout. The timeout applies to individual attempts to send data to the backend.
func NewDefaultTimeoutConfig ¶ added in v0.110.0
func NewDefaultTimeoutConfig() TimeoutConfig
NewDefaultTimeoutConfig returns the default config for TimeoutConfig.
func (*TimeoutConfig) Validate ¶ added in v0.110.0
func (ts *TimeoutConfig) Validate() error