Help us shape the future of Go! Take the 2026 Go Developer Survey

experimentprocessor

package module
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 13 Imported by: 1

README

This processor supports randomized routing in an OpenTelemetry collector processor. This code's structure is copied from the collector-contrib routingprocessor, but it is substantially simpler.

The routing table consists of a table of weights with associated list of exporters (by name). This method of traffic splitting is modeled on Envoy's support for multiple "upstreams".

For example, to send 1% of data to an experimental exporter, use the following configuration.

processors:
  experiment:
    table:
    - weight: 1
      exporters: [otlp/experiment]
    - weight: 99
      exporters: [otlp/standard]

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory() processor.Factory

NewFactory creates a factory for the routing processor.

Types

type Config

type Config struct {
	// Table contains the routing table for this processor.
	// Required, must be non-empty.
	Table []RoutingTableItem `mapstructure:"table"`
}

Config defines configuration for the Routing processor.

func (*Config) Validate

func (c *Config) Validate() error

Validate checks if the processor configuration is valid.

type RoutingTableItem

type RoutingTableItem struct {
	// Weight is relative weight within the table.
	Weight int `mapstructure:"weight"`

	// Exporters contains the list of exporters to use when this
	// table item is selected.  Must be non-empty.
	Exporters []string `mapstructure:"exporters"`
}

RoutingTableItem specifies how data should be routed to the different exporters

Jump to

Keyboard shortcuts

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