queuedprocessor

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 17 Imported by: 0

README

Queued Retry Processor

Supported pipeline types: traces

The queued retry processor uses a bounded queue to relay batches from the receiver or previous processor to the next processor. Received data is enqueued immediately if the queue is not full. At the same time, the processor has one or more workers which consume the data in the queue by sending them to the next processor or exporter. If relaying the data to the next processor or exporter in the pipeline fails, the processor retries after some backoff delay depending on the configuration.

Some important things to keep in mind with the queued_retry processor:

  • Given that if the queue is full the data will be dropped, it is important to size the queue appropriately.
  • Since the queue is based on batches and batch sizes are environment specific, it may not be easy to understand how much memory a queue will consume.
  • Finally, the queue size is dependent on the deployment model of the collector. The agent deployment model typically has a smaller queue than the collector deployment model.

It is highly recommended to configure the queued_retry processor on every collector as it minimizes the likelihood of data being dropped due to delays in processing or issues exporting the data. This processor should be the last processor defined in the pipeline because issues that require retry are typically due to exporting.

Please refer to config.go for the config spec.

The following configuration options can be modified:

  • backoff_delay (default = 5s): Time interval to wait before retrying
  • num_workers (default = 10): Number of workers that dequeue batches
  • queue_size (default = 5000): Maximum number of batches kept in memory before data is dropped
  • retry_on_failure (default = true): Whether to retry on failure or give up and drop

Examples:

processors:
  queued_retry/example:
    backoff_delay: 5s
    num_workers: 2
    queue_size: 10
    retry_on_failure: true

Refer to config.yaml for detailed examples on using the processor.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MetricViews

func MetricViews(level telemetry.Level) []*view.View

MetricViews return the metrics views according to given telemetry level.

Types

type Config

type Config struct {
	configmodels.ProcessorSettings `mapstructure:",squash"`

	// NumWorkers is the number of queue workers that dequeue batches and send them out.
	NumWorkers int `mapstructure:"num_workers"`
	// QueueSize is the maximum number of batches allowed in queue at a given time.
	QueueSize int `mapstructure:"queue_size"`
	// Retry indicates whether queue processor should retry span batches in case of processing failure.
	RetryOnFailure bool `mapstructure:"retry_on_failure"`
	// BackoffDelay is the amount of time a worker waits after a failed send before retrying.
	BackoffDelay time.Duration `mapstructure:"backoff_delay"`
}

Config defines configuration for Attributes processor.

type Factory

type Factory struct {
}

Factory is the factory for OpenCensus exporter.

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() configmodels.Processor

CreateDefaultConfig creates the default configuration for exporter.

func (*Factory) CreateMetricsProcessor

func (f *Factory) CreateMetricsProcessor(
	ctx context.Context,
	params component.ProcessorCreateParams,
	nextConsumer consumer.MetricsConsumer,
	cfg configmodels.Processor,
) (component.MetricsProcessor, error)

CreateMetricsProcessor creates a metrics processor based on this config.

func (*Factory) CreateTraceProcessor

func (f *Factory) CreateTraceProcessor(
	ctx context.Context,
	params component.ProcessorCreateParams,
	nextConsumer consumer.TraceConsumer,
	cfg configmodels.Processor,
) (component.TraceProcessor, error)

CreateTraceProcessor creates a trace processor based on this config.

func (*Factory) Type

func (f *Factory) Type() configmodels.Type

Type gets the type of the Option config created by this factory.

Jump to

Keyboard shortcuts

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