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 NewMetrics(ctx context.Context, set exporter.Settings, cfg component.Config, ...) (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)
- type BatchConfig
- type Option
- func WithAttrs(attrs ...attribute.KeyValue) Option
- func WithCapabilities(capabilities consumer.Capabilities) Option
- func WithQueue(config configoptional.Optional[QueueBatchConfig]) 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 QueueBatchConfig
- type QueueBatchEncoding
- type RequestSizerType
- type TimeoutConfig
Constants ¶
This section is empty.
Variables ¶
var ( RequestSizerTypeBytes = request.SizerTypeBytes RequestSizerTypeItems = request.SizerTypeItems RequestSizerTypeRequests = request.SizerTypeRequests )
var ErrQueueIsFull = queue.ErrQueueIsFull
var NewDefaultBatchConfig = queuebatch.NewDefaultBatchConfig
NewDefaultBatchConfig returns the default config for BatchConfig.
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 ¶
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 NewMetrics ¶
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 NewThrottleRetry ¶
NewThrottleRetry creates a new throttle retry error.
Types ¶
type BatchConfig ¶
type BatchConfig = queuebatch.BatchConfig
BatchConfig defines a configuration for batching requests based on a timeout and a minimum number of items.
type Option ¶
Option apply changes to BaseExporter.
func WithAttrs ¶ added in v0.151.0
WithAttrs adds extra attributes to the metrics produced by the exporter The default set of extra attribute is empty
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 configoptional.Optional[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 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 ¶
type QueueBatchConfig = queuebatch.Config
QueueBatchConfig defines configuration for queueing and batching for the exporter.
type QueueBatchEncoding ¶
type QueueBatchEncoding[T any] interface { // Marshal is a function that can marshal a request and its context into bytes. Marshal(context.Context, T) ([]byte, error) // Unmarshal is a function that can unmarshal bytes into a request and its context. Unmarshal([]byte) (context.Context, 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 RequestSizerType ¶
type TimeoutConfig ¶
type TimeoutConfig = internal.TimeoutConfig
TimeoutConfig a timeout configuration. The timeout applies to individual attempts to send data to the backend.
func NewDefaultTimeoutConfig ¶
func NewDefaultTimeoutConfig() TimeoutConfig
NewDefaultTimeoutConfig returns a new TimeoutConfig with its default values applied. Prefer this over an empty struct literal so default changes stay in sync automatically.
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
|