Documentation
¶
Overview ¶
Package exporterhelper provides helper functions for exporters.
Index ¶
- Variables
- func NewLogs(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (exporter.Logs, error)
- func NewLogsRequest(_ context.Context, set exporter.Settings, ...) (exporter.Logs, error)
- func NewMetrics(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (exporter.Metrics, error)
- func NewMetricsRequest(_ context.Context, set exporter.Settings, ...) (exporter.Metrics, error)
- func NewThrottleRetry(err error, delay time.Duration) error
- func NewTraces(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (exporter.Traces, error)
- func NewTracesRequest(_ context.Context, set exporter.Settings, ...) (exporter.Traces, error)
- type BatchConfig
- type BatcherConfigdeprecated
- type Option
- func WithBatcher(cfg BatcherConfig) Optiondeprecated
- func WithCapabilities(capabilities consumer.Capabilities) Option
- func WithQueue(config QueueBatchConfig) Option
- func WithQueueBatch(cfg QueueBatchConfig, set QueueBatchSettings) Option
- func WithRequestQueue(cfg QueueBatchConfig, encoding QueueBatchEncoding[Request]) Optiondeprecated
- func WithRetry(config configretry.BackOffConfig) Option
- func WithShutdown(shutdown component.ShutdownFunc) Option
- func WithStart(start component.StartFunc) Option
- func WithTimeout(timeoutConfig TimeoutConfig) Option
- type QueueBatchConfig
- type QueueBatchEncoding
- type QueueBatchSettings
- type QueueConfigdeprecated
- type Request
- type RequestConsumeFunc
- type RequestConverterFunc
- type RequestErrorHandler
- type RequestSizer
- type RequestSizerType
- type SizeConfigdeprecated
- type TimeoutConfig
Constants ¶
This section is empty.
Variables ¶
var ( RequestSizerTypeBytes = request.SizerTypeBytes RequestSizerTypeItems = request.SizerTypeItems RequestSizerTypeRequests = request.SizerTypeRequests )
var ErrQueueIsFull = queuebatch.ErrQueueIsFull
var NewDefaultBatcherConfig = internal.NewDefaultBatcherConfig
Deprecated: [v0.123.0] use WithQueueBatch.
var NewDefaultQueueConfig = internal.NewDefaultQueueConfig
NewDefaultQueueConfig returns the default config for QueueBatchConfig. By default, the queue stores 1000 requests of telemetry and is non-blocking when full.
Functions ¶
func NewLogs ¶ added in v0.112.0
func NewLogs( ctx context.Context, set exporter.Settings, cfg component.Config, pusher consumer.ConsumeLogsFunc, options ...Option, ) (exporter.Logs, error)
NewLogs creates an exporter.Logs that records observability logs and wraps every request with a Span.
func NewLogsRequest ¶ added in v0.112.0
func NewLogsRequest( _ context.Context, set exporter.Settings, converter RequestConverterFunc[plog.Logs], pusher RequestConsumeFunc, options ...Option, ) (exporter.Logs, error)
NewLogsRequest creates new logs exporter based on custom LogsConverter and Sender. 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 NewMetrics ¶ added in v0.112.0
func NewMetrics( ctx context.Context, set exporter.Settings, cfg component.Config, pusher consumer.ConsumeMetricsFunc, options ...Option, ) (exporter.Metrics, error)
NewMetrics creates an exporter.Metrics that records observability metrics and wraps every request with a Span.
func NewMetricsRequest ¶ added in v0.112.0
func NewMetricsRequest( _ context.Context, set exporter.Settings, converter RequestConverterFunc[pmetric.Metrics], pusher RequestConsumeFunc, options ...Option, ) (exporter.Metrics, error)
NewMetricsRequest creates a new metrics exporter based on a custom MetricsConverter and Sender. 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 NewTraces ¶ added in v0.112.0
func NewTraces( ctx context.Context, set exporter.Settings, cfg component.Config, pusher consumer.ConsumeTracesFunc, options ...Option, ) (exporter.Traces, error)
NewTraces creates an exporter.Traces that records observability metrics and wraps every request with a Span.
func NewTracesRequest ¶ added in v0.112.0
func NewTracesRequest( _ context.Context, set exporter.Settings, converter RequestConverterFunc[ptrace.Traces], pusher RequestConsumeFunc, options ...Option, ) (exporter.Traces, error)
NewTracesRequest creates a new traces exporter based on a custom TracesConverter and Sender. 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 BatchConfig ¶ added in v0.123.0
type BatchConfig = queuebatch.BatchConfig
BatchConfig defines a configuration for batching requests based on a timeout and a minimum number of items.
type BatcherConfig
deprecated
added in
v0.123.0
type BatcherConfig = internal.BatcherConfig
Deprecated: [v0.123.0] use WithQueueBatch.
type Option ¶
Option apply changes to BaseExporter.
func WithBatcher
deprecated
added in
v0.97.0
func WithBatcher(cfg BatcherConfig) Option
Deprecated: [v0.123.0] use WithQueueBatch.
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 QueueBatchConfig) Option
WithQueue overrides the default QueueBatchConfig for an exporter. The default QueueBatchConfig is to disable queueing. This option cannot be used with the new exporter helpers New[Traces|Metrics|Logs]RequestExporter.
func WithQueueBatch ¶ added in v0.123.0
func WithQueueBatch(cfg QueueBatchConfig, set QueueBatchSettings) Option
WithQueueBatch enables queueing and batching 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 WithRequestQueue
deprecated
added in
v0.94.0
func WithRequestQueue(cfg QueueBatchConfig, encoding QueueBatchEncoding[Request]) Option
Deprecated: [v0.123.0] use WithQueueBatch.
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 QueueBatchConfig ¶ added in v0.123.0
type QueueBatchConfig = queuebatch.Config
QueueBatchConfig defines configuration for queueing and batching for the exporter.
type QueueBatchEncoding ¶ added in v0.123.0
type QueueBatchEncoding[T any] interface { // Marshal is a function that can marshal a request into bytes. Marshal(T) ([]byte, error) // Unmarshal is a function that can unmarshal bytes into a request. Unmarshal([]byte) (T, error) }
QueueBatchEncoding defines the encoding to be used if persistent queue is configured. Duplicate definition with queuebatch.Encoding since aliasing generics is not supported by default.
type QueueBatchSettings ¶ added in v0.123.0
type QueueBatchSettings = internal.QueueBatchSettings[Request]
QueueBatchSettings are settings for the QueueBatch component. They include things line Encoding to be used with persistent queue, or the available Sizers, etc.
func NewLogsQueueBatchSettings ¶ added in v0.123.0
func NewLogsQueueBatchSettings() QueueBatchSettings
NewLogsQueueBatchSettings returns a new QueueBatchSettings to configure to WithQueueBatch when using plog.Logs. 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 NewMetricsQueueBatchSettings ¶ added in v0.123.0
func NewMetricsQueueBatchSettings() QueueBatchSettings
NewMetricsQueueBatchSettings returns a new QueueBatchSettings to configure to WithQueueBatch when using pmetric.Metrics. 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 NewTracesQueueBatchSettings ¶ added in v0.123.0
func NewTracesQueueBatchSettings() QueueBatchSettings
NewTracesQueueBatchSettings returns a new QueueBatchSettings to configure to WithQueueBatch when using ptrace.Traces. 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 QueueConfig
deprecated
added in
v0.110.0
type QueueConfig = QueueBatchConfig
Deprecated: [v0.123.0] use QueueBatchConfig.
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 RequestConsumeFunc ¶ added in v0.122.0
RequestConsumeFunc processes the request. After the function returns, the request is no longer accessible, and accessing it is considered undefined behavior.
type RequestConverterFunc ¶ added in v0.122.0
RequestConverterFunc converts pdata telemetry 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 RequestErrorHandler ¶ added in v0.89.0
type RequestErrorHandler = request.ErrorHandler
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 RequestSizer ¶ added in v0.123.0
RequestSizer is an interface that returns the size of the given request.
func NewRequestsSizer ¶ added in v0.123.0
func NewRequestsSizer() RequestSizer
NewRequestsSizer returns a RequestSizer that counts the requests by the number of requests, always returning 1.
type RequestSizerType ¶ added in v0.123.0
type SizeConfig
deprecated
added in
v0.123.0
type SizeConfig = internal.SizeConfig
Deprecated: [v0.123.0] use WithQueueBatch.
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.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
exporterhelperprofiles
module
|
|
queuebatch
Package queuebatch provides helper functions for exporter's queueing and batching.
|
Package queuebatch provides helper functions for exporter's queueing and batching. |
xexporterhelper
module
|