Documentation
¶
Overview ¶
Package exporterhelper provides helper functions for exporters.
Index ¶
- func NewLogsExporter(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (exporter.Logs, error)
- func NewLogsRequestExporter(_ context.Context, set exporter.Settings, converter RequestFromLogsFunc, ...) (exporter.Logs, error)
- func NewMetricsExporter(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (exporter.Metrics, error)
- func NewMetricsRequestExporter(_ context.Context, set exporter.Settings, converter RequestFromMetricsFunc, ...) (exporter.Metrics, error)
- func NewThrottleRetry(err error, delay time.Duration) error
- func NewTracesExporter(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (exporter.Traces, error)
- func NewTracesRequestExporter(_ context.Context, set exporter.Settings, converter RequestFromTracesFunc, ...) (exporter.Traces, error)
- type BatcherOption
- type Option
- func WithBatcher(cfg exporterbatcher.Config, opts ...BatcherOption) Option
- func WithCapabilities(capabilities consumer.Capabilities) Option
- func WithQueue(config internal.QueueConfig) Option
- func WithRequestQueue(cfg exporterqueue.Config, queueFactory exporterqueue.Factory[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 QueueConfig
- type Request
- type RequestErrorHandler
- type RequestFromLogsFunc
- type RequestFromMetricsFunc
- type RequestFromTracesFunc
- type TimeoutConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLogsExporter ¶
func NewLogsExporter( ctx context.Context, set exporter.Settings, cfg component.Config, pusher consumer.ConsumeLogsFunc, options ...Option, ) (exporter.Logs, error)
NewLogsExporter creates an exporter.Logs that records observability metrics and wraps every request with a Span.
func NewLogsRequestExporter ¶ added in v0.84.0
func NewLogsRequestExporter( _ context.Context, set exporter.Settings, converter RequestFromLogsFunc, options ...Option, ) (exporter.Logs, error)
NewLogsRequestExporter creates new logs exporter based on custom LogsConverter and RequestSender. 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 NewMetricsExporter ¶
func NewMetricsExporter( ctx context.Context, set exporter.Settings, cfg component.Config, pusher consumer.ConsumeMetricsFunc, options ...Option, ) (exporter.Metrics, error)
NewMetricsExporter creates an exporter.Metrics that records observability metrics and wraps every request with a Span.
func NewMetricsRequestExporter ¶ added in v0.84.0
func NewMetricsRequestExporter( _ context.Context, set exporter.Settings, converter RequestFromMetricsFunc, options ...Option, ) (exporter.Metrics, error)
NewMetricsRequestExporter creates a new metrics exporter based on a custom MetricsConverter and RequestSender. 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 NewThrottleRetry ¶
NewThrottleRetry creates a new throttle retry error.
func NewTracesExporter ¶
func NewTracesExporter( ctx context.Context, set exporter.Settings, cfg component.Config, pusher consumer.ConsumeTracesFunc, options ...Option, ) (exporter.Traces, error)
NewTracesExporter creates an exporter.Traces that records observability metrics and wraps every request with a Span.
func NewTracesRequestExporter ¶ added in v0.84.0
func NewTracesRequestExporter( _ context.Context, set exporter.Settings, converter RequestFromTracesFunc, options ...Option, ) (exporter.Traces, error)
NewTracesRequestExporter creates a new traces exporter based on a custom TracesConverter and RequestSender. 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.
Types ¶
type BatcherOption ¶ added in v0.97.0
type BatcherOption = internal.BatcherOption
BatcherOption apply changes to batcher sender.
func WithRequestBatchFuncs ¶ added in v0.97.0
func WithRequestBatchFuncs(mf exporterbatcher.BatchMergeFunc[Request], msf exporterbatcher.BatchMergeSplitFunc[Request]) BatcherOption
WithRequestBatchFuncs sets the functions for merging and splitting batches for an exporter built for custom request types.
type Option ¶
Option apply changes to BaseExporter.
func WithBatcher ¶ added in v0.97.0
func WithBatcher(cfg exporterbatcher.Config, opts ...BatcherOption) 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 ¶
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 ¶
func WithQueue(config internal.QueueConfig) 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.94.0
func WithRequestQueue(cfg exporterqueue.Config, queueFactory exporterqueue.Factory[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 ¶
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 ¶
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 ¶
WithStart overrides the default Start function for an exporter. The default start function does nothing and always returns nil.
func WithTimeout ¶
func WithTimeout(timeoutConfig TimeoutConfig) Option
WithTimeout overrides the default TimeoutConfig for an exporter. The default TimeoutConfig is 5 seconds.
type QueueConfig ¶ added in v0.110.0
type QueueConfig = internal.QueueConfig
QueueConfig defines configuration for queueing batches before sending to the consumerSender.
func NewDefaultQueueConfig ¶ added in v0.110.0
func NewDefaultQueueConfig() QueueConfig
NewDefaultQueueConfig returns the default config for QueueConfig.
type Request ¶ added in v0.84.0
Request represents a single request that can be sent to an external endpoint. 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.
type RequestErrorHandler ¶ added in v0.89.0
type RequestErrorHandler = internal.RequestErrorHandler
RequestErrorHandler is an optional interface that can be implemented by Request to provide a way handle partial temporary failures. For example, if some items failed to process and can be retried, this interface allows to return a new Request that contains the items left to be sent. Otherwise, the original Request should be returned. If not implemented, the original Request will be returned assuming the error is applied to the whole Request. 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.
type RequestFromLogsFunc ¶ added in v0.90.0
RequestFromLogsFunc converts plog.Logs data into a user-defined request. 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.
type RequestFromMetricsFunc ¶ added in v0.90.0
RequestFromMetricsFunc converts pdata.Metrics into a user-defined request. 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.
type RequestFromTracesFunc ¶ added in v0.90.0
RequestFromTracesFunc converts ptrace.Traces into a user-defined Request. 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.
type TimeoutConfig ¶ added in v0.110.0
type TimeoutConfig = internal.TimeoutConfig
func NewDefaultTimeoutConfig ¶ added in v0.110.0
func NewDefaultTimeoutConfig() TimeoutConfig
NewDefaultTimeoutConfig returns the default config for TimeoutConfig.