exporterqueue

package
v0.0.0-...-76a0d45 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrQueueIsFull = queue.ErrQueueIsFull

ErrQueueIsFull is the error that Queue returns when full. 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.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Enabled indicates whether to not enqueue batches before exporting.
	Enabled bool `mapstructure:"enabled"`
	// NumConsumers is the number of consumers from the queue.
	NumConsumers int `mapstructure:"num_consumers"`
	// QueueSize is the maximum number of requests allowed in queue at any given time.
	QueueSize int `mapstructure:"queue_size"`
}

Config defines configuration for queueing requests before exporting. It's supposed to 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 NewDefaultConfig

func NewDefaultConfig() Config

NewDefaultConfig returns the default Config. 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 (*Config) Validate

func (qCfg *Config) Validate() error

Validate checks if the QueueSettings configuration is valid

type Factory

type Factory[T any] func(context.Context, Settings, Config) Queue[T]

Factory is a function that creates a new queue. 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 NewMemoryQueueFactory

func NewMemoryQueueFactory[T itemsCounter]() Factory[T]

NewMemoryQueueFactory returns a factory to create a new memory queue. 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 NewPersistentQueueFactory

func NewPersistentQueueFactory[T itemsCounter](storageID *component.ID, factorySettings PersistentQueueSettings[T]) Factory[T]

NewPersistentQueueFactory returns a factory to create a new persistent queue. If cfg.StorageID is nil then it falls back to memory queue. 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 Marshaler

type Marshaler[T any] func(T) ([]byte, error)

Marshaler is a function that can marshal a request into bytes. 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 PersistentQueueConfig

type PersistentQueueConfig struct {
	Config `mapstructure:",squash"`
	// StorageID if not empty, enables the persistent storage and uses the component specified
	// as a storage extension for the persistent queue
	StorageID *component.ID `mapstructure:"storage"`
}

PersistentQueueConfig defines configuration for queueing requests in a persistent storage. The struct is provided to be added in the exporter configuration as one struct under the "sending_queue" key. The exporter helper Go interface requires the fields to be provided separately to WithRequestQueue and NewPersistentQueueFactory. 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 PersistentQueueSettings

type PersistentQueueSettings[T any] struct {
	// Marshaler is used to serialize queue elements before storing them in the persistent storage.
	Marshaler Marshaler[T]
	// Unmarshaler is used to deserialize requests after reading them from the persistent storage.
	Unmarshaler Unmarshaler[T]
}

PersistentQueueSettings defines developer settings for the persistent queue factory. 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 Queue

type Queue[T any] queue.Queue[T]

Queue defines a producer-consumer exchange which can be backed by e.g. the memory-based ring buffer queue (boundedMemoryQueue) or via a disk-based queue (persistentQueue) 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 Settings

type Settings struct {
	DataType         component.DataType
	ExporterSettings exporter.CreateSettings
}

Settings defines settings for creating a queue.

type Unmarshaler

type Unmarshaler[T any] func([]byte) (T, error)

Unmarshaler is a function that can unmarshal bytes into a 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL