Documentation
¶
Overview ¶
Package exporterhelper provides helper functions for exporters.
Index ¶
- Variables
- func NewLogsExporter(cfg config.Exporter, set component.ExporterCreateSettings, ...) (component.LogsExporter, error)
- func NewMetricsExporter(cfg config.Exporter, set component.ExporterCreateSettings, ...) (component.MetricsExporter, error)
- func NewThrottleRetry(err error, delay time.Duration) error
- func NewTracesExporter(cfg config.Exporter, set component.ExporterCreateSettings, ...) (component.TracesExporter, error)
- type CreateDefaultConfigdeprecated
- type CreateLogsExporterdeprecated
- type CreateMetricsExporterdeprecated
- type CreateTracesExporterdeprecated
- type FactoryOptiondeprecated
- type Option
- func WithCapabilities(capabilities consumer.Capabilities) Option
- func WithQueue(queueSettings QueueSettings) Option
- func WithRetry(retrySettings RetrySettings) Option
- func WithShutdown(shutdown component.ShutdownFunc) Option
- func WithStart(start component.StartFunc) Option
- func WithTimeout(timeoutSettings TimeoutSettings) Option
- type QueueSettings
- type RetrySettings
- type TimeoutSettings
Constants ¶
This section is empty.
Variables ¶
var DefaultQueueSettings = NewDefaultQueueSettings
Deprecated: [v0.46.0] use NewDefaultQueueSettings instead.
var DefaultRetrySettings = NewDefaultRetrySettings
Deprecated: [v0.46.0] use NewDefaultRetrySettings instead.
var DefaultTimeoutSettings = NewDefaultTimeoutSettings
Deprecated: [v0.46.0] use NewDefaultTimeoutSettings instead.
var NewFactory = component.NewExporterFactory
Deprecated: [v0.46.0] use component.NewExporterFactory.
var WithLogs = component.WithLogsExporter
Deprecated: [v0.46.0] use component.WithLogsExporter.
var WithMetrics = component.WithMetricsExporter
Deprecated: [v0.46.0] use component.WithMetricsExporter.
var WithTraces = component.WithTracesExporter
Deprecated: [v0.46.0] use component.WithTracesExporter.
Functions ¶
func NewLogsExporter ¶
func NewLogsExporter( cfg config.Exporter, set component.ExporterCreateSettings, pusher consumerhelper.ConsumeLogsFunc, options ...Option, ) (component.LogsExporter, error)
NewLogsExporter creates an LogsExporter that records observability metrics and wraps every request with a Span.
func NewMetricsExporter ¶
func NewMetricsExporter( cfg config.Exporter, set component.ExporterCreateSettings, pusher consumerhelper.ConsumeMetricsFunc, options ...Option, ) (component.MetricsExporter, error)
NewMetricsExporter creates an MetricsExporter that records observability metrics and wraps every request with a Span.
func NewThrottleRetry ¶ added in v0.7.0
NewThrottleRetry creates a new throttle retry error.
func NewTracesExporter ¶ added in v0.25.0
func NewTracesExporter( cfg config.Exporter, set component.ExporterCreateSettings, pusher consumerhelper.ConsumeTracesFunc, options ...Option, ) (component.TracesExporter, error)
NewTracesExporter creates a TracesExporter that records observability metrics and wraps every request with a Span.
Types ¶
type CreateDefaultConfig
deprecated
added in
v0.7.0
type CreateDefaultConfig = component.ExporterCreateDefaultConfigFunc
Deprecated: [v0.46.0] use component.ExporterCreateDefaultConfigFunc.
type CreateLogsExporter
deprecated
added in
v0.7.0
type CreateLogsExporter = component.CreateLogsExporterFunc
Deprecated: [v0.46.0] use component.CreateLogsExporterFunc.
type CreateMetricsExporter
deprecated
added in
v0.7.0
type CreateMetricsExporter = component.CreateMetricsExporterFunc
Deprecated: [v0.46.0] use component.CreateMetricsExporterFunc.
type CreateTracesExporter
deprecated
added in
v0.24.0
type CreateTracesExporter = component.CreateTracesExporterFunc
Deprecated: [v0.46.0] use component.CreateTracesExporterFunc.
type FactoryOption
deprecated
added in
v0.7.0
type FactoryOption = component.ExporterFactoryOption
Deprecated: [v0.46.0] use component.ExporterFactoryOption.
type Option ¶ added in v0.16.0
type Option func(*baseSettings)
Option apply changes to baseSettings.
func WithCapabilities ¶ added in v0.27.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 WithQueue ¶ added in v0.7.0
func WithQueue(queueSettings QueueSettings) Option
WithQueue overrides the default QueueSettings for an exporter. The default QueueSettings is to disable queueing.
func WithRetry ¶ added in v0.7.0
func WithRetry(retrySettings RetrySettings) Option
WithRetry overrides the default RetrySettings for an exporter. The default RetrySettings is to disable retries.
func WithShutdown ¶
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.6.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.7.0
func WithTimeout(timeoutSettings TimeoutSettings) Option
WithTimeout overrides the default TimeoutSettings for an exporter. The default TimeoutSettings is 5 seconds.
type QueueSettings ¶ added in v0.7.0
type QueueSettings struct { // Enabled indicates whether to not enqueue batches before sending to the consumerSender. Enabled bool `mapstructure:"enabled"` // NumConsumers is the number of consumers from the queue. NumConsumers int `mapstructure:"num_consumers"` // QueueSize is the maximum number of batches allowed in queue at a given time. QueueSize int `mapstructure:"queue_size"` }
QueueSettings defines configuration for queueing batches before sending to the consumerSender.
func NewDefaultQueueSettings ¶ added in v0.46.0
func NewDefaultQueueSettings() QueueSettings
NewDefaultQueueSettings returns the default settings for QueueSettings.
func (*QueueSettings) Validate ¶ added in v0.45.0
func (qCfg *QueueSettings) Validate() error
Validate checks if the QueueSettings configuration is valid
type RetrySettings ¶ added in v0.7.0
type RetrySettings struct { // Enabled indicates whether to not retry sending batches in case of export failure. Enabled bool `mapstructure:"enabled"` // InitialInterval the time to wait after the first failure before retrying. InitialInterval time.Duration `mapstructure:"initial_interval"` // MaxInterval is the upper bound on backoff interval. Once this value is reached the delay between // consecutive retries will always be `MaxInterval`. MaxInterval time.Duration `mapstructure:"max_interval"` // MaxElapsedTime is the maximum amount of time (including retries) spent trying to send a request/batch. // Once this value is reached, the data is discarded. MaxElapsedTime time.Duration `mapstructure:"max_elapsed_time"` }
RetrySettings defines configuration for retrying batches in case of export failure. The current supported strategy is exponential backoff.
func NewDefaultRetrySettings ¶ added in v0.46.0
func NewDefaultRetrySettings() RetrySettings
NewDefaultRetrySettings returns the default settings for RetrySettings.
type TimeoutSettings ¶ added in v0.7.0
type TimeoutSettings struct { // Timeout is the timeout for every attempt to send data to the backend. Timeout time.Duration `mapstructure:"timeout"` }
TimeoutSettings for timeout. The timeout applies to individual attempts to send data to the backend.
func NewDefaultTimeoutSettings ¶ added in v0.46.0
func NewDefaultTimeoutSettings() TimeoutSettings
NewDefaultTimeoutSettings returns the default settings for TimeoutSettings.