builder

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package builder contains the logic on parsing configs and building receivers, exporters, pipeplines and tail sampling.

Package builder handles the options to build the OpenCensus collector pipeline.

Index

Constants

View Source
const (
	// ThriftTChannelSenderType represents a thrift-format tchannel-transport sender
	ThriftTChannelSenderType SenderType = "jaeger-thrift-tchannel"
	// ThriftHTTPSenderType represents a thrift-format http-transport sender
	ThriftHTTPSenderType = "jaeger-thrift-http"
	// ProtoGRPCSenderType represents a proto-format grpc-transport sender
	ProtoGRPCSenderType = "jaeger-proto-grpc"
	// InvalidSenderType represents an invalid sender
	InvalidSenderType = "invalid"
)

Variables

This section is empty.

Functions

func Flags

func Flags(flags *flag.FlagSet)

Flags adds flags related to basic building of the collector application to the given flagset.

func GetConfigFile

func GetConfigFile(v *viper.Viper) string

GetConfigFile gets the config file from the config file flag.

func MemBallastSize

func MemBallastSize(v *viper.Viper) int

MemBallastSize returns the size of memory ballast to use in MBs

Types

type AttributesCfg

type AttributesCfg struct {
	Overwrite       bool                                   `mapstructure:"overwrite"`
	Values          map[string]interface{}                 `mapstructure:"values"`
	KeyReplacements []attributekeyprocessor.KeyReplacement `mapstructure:"key-mapping,omitempty"`
}

AttributesCfg holds configuration for attributes that can be added to all spans going through a processor.

type BatchingConfig

type BatchingConfig struct {
	// Enable marks batching as enabled or not
	Enable bool `mapstructure:"enable"`
	// Timeout sets the time after which a batch will be sent regardless of size
	Timeout *time.Duration `mapstructure:"timeout,omitempty"`
	// SendBatchSize is the size of a batch which after hit, will trigger it to be sent.
	SendBatchSize *int `mapstructure:"send-batch-size,omitempty"`

	// NumTickers sets the number of tickers to use to divide the work of looping
	// over batch buckets. This is an advanced configuration option.
	NumTickers int `mapstructure:"num-tickers,omitempty"`
	// TickTime sets time interval at which the tickers tick. This is an advanced
	// configuration option.
	TickTime *time.Duration `mapstructure:"tick-time,omitempty"`
	// RemoveAfterTicks is the number of ticks that must pass without a span arriving
	// from a node after which the batcher for that node will be deleted. This is an
	// advanved configuration option.
	RemoveAfterTicks *int `mapstructure:"remove-after-ticks,omitempty"`
}

BatchingConfig contains configuration around the queueing batching. It contains some advanced configurations, which should not be used by a typical user, but are provided as advanced features to increase scalability.

type Exporters

type Exporters map[configmodels.Exporter]*builtExporter

Exporters is a map of exporters created from exporter configs.

func (Exporters) StopAll

func (exps Exporters) StopAll()

StopAll stops all exporters.

type ExportersBuilder

type ExportersBuilder struct {
	// contains filtered or unexported fields
}

ExportersBuilder builds exporters from config.

func NewExportersBuilder

func NewExportersBuilder(
	logger *zap.Logger,
	config *configmodels.Config,
	factories map[string]exporter.Factory,
) *ExportersBuilder

NewExportersBuilder creates a new ExportersBuilder. Call Build() on the returned value.

func (*ExportersBuilder) Build

func (eb *ExportersBuilder) Build() (Exporters, error)

Build exporters from config.

type GlobalProcessorCfg

type GlobalProcessorCfg struct {
	Attributes *AttributesCfg `mapstructure:"attributes"`
}

GlobalProcessorCfg holds global configuration values that apply to all processors

type JaegerProtoGRPCSenderCfg

type JaegerProtoGRPCSenderCfg struct {
	CollectorEndpoint string `mapstructure:"collector-endpoint"`
}

JaegerProtoGRPCSenderCfg holds configuration for Jaeger Proto GRPC sender

func NewJaegerProtoGRPCSenderCfg

func NewJaegerProtoGRPCSenderCfg() *JaegerProtoGRPCSenderCfg

NewJaegerProtoGRPCSenderCfg returns an instance of JaegerProtoGRPCSenderCfg with default values

type JaegerThriftHTTPSenderCfg

type JaegerThriftHTTPSenderCfg struct {
	CollectorEndpoint string            `mapstructure:"collector-endpoint"`
	Timeout           time.Duration     `mapstructure:"timeout"`
	Headers           map[string]string `mapstructure:"headers"`
}

JaegerThriftHTTPSenderCfg holds configuration for Jaeger Thrift HTTP sender

func NewJaegerThriftHTTPSenderCfg

func NewJaegerThriftHTTPSenderCfg() *JaegerThriftHTTPSenderCfg

NewJaegerThriftHTTPSenderCfg returns an instance of JaegerThriftHTTPSenderCfg with default values

type JaegerThriftTChannelSenderCfg

type JaegerThriftTChannelSenderCfg struct {
	CollectorHostPorts        []string      `mapstructure:"collector-host-ports"`
	DiscoveryMinPeers         int           `mapstructure:"discovery-min-peers"`
	DiscoveryConnCheckTimeout time.Duration `mapstructure:"discovery-conn-check-timeout"`
}

JaegerThriftTChannelSenderCfg holds configuration for Jaeger Thrift Tchannel sender

func NewJaegerThriftTChannelSenderCfg

func NewJaegerThriftTChannelSenderCfg() *JaegerThriftTChannelSenderCfg

NewJaegerThriftTChannelSenderCfg returns an instance of JaegerThriftTChannelSenderCfg with default values

type MultiSpanProcessorCfg

type MultiSpanProcessorCfg struct {
	Processors []*QueuedSpanProcessorCfg
	Global     *GlobalProcessorCfg `mapstructure:"global"`
}

MultiSpanProcessorCfg holds configuration for all the span processors

func NewDefaultMultiSpanProcessorCfg

func NewDefaultMultiSpanProcessorCfg() *MultiSpanProcessorCfg

NewDefaultMultiSpanProcessorCfg returns an instance of MultiSpanProcessorCfg with default values

func (*MultiSpanProcessorCfg) InitFromViper

func (mOpts *MultiSpanProcessorCfg) InitFromViper(v *viper.Viper) *MultiSpanProcessorCfg

InitFromViper initializes MultiSpanProcessorCfg with properties from viper

type PipelineProcessors

type PipelineProcessors map[*configmodels.Pipeline]*builtProcessor

PipelineProcessors is a map of entry-point processors created from pipeline configs. Each element of the map points to the first processor of the pipeline.

type PipelinesBuilder

type PipelinesBuilder struct {
	// contains filtered or unexported fields
}

PipelinesBuilder builds pipelines from config.

func NewPipelinesBuilder

func NewPipelinesBuilder(
	logger *zap.Logger,
	config *configmodels.Config,
	exporters Exporters,
	factories map[string]processor.Factory,
) *PipelinesBuilder

NewPipelinesBuilder creates a new PipelinesBuilder. Requires exporters to be already built via ExportersBuilder. Call Build() on the returned value.

func (*PipelinesBuilder) Build

func (pb *PipelinesBuilder) Build() (PipelineProcessors, error)

Build pipeline processors from config.

type QueuedSpanProcessorCfg

type QueuedSpanProcessorCfg struct {
	// Name is the friendly name of the processor
	Name string
	// 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"`
	// SenderType indicates the type of sender to instantiate
	SenderType   SenderType `mapstructure:"sender-type"`
	SenderConfig interface{}
	// BatchingConfig sets config parameters related to batching
	BatchingConfig BatchingConfig `mapstructure:"batching"`
	RawConfig      *viper.Viper
}

QueuedSpanProcessorCfg holds configuration for the queued span processor

func NewDefaultQueuedSpanProcessorCfg

func NewDefaultQueuedSpanProcessorCfg() *QueuedSpanProcessorCfg

NewDefaultQueuedSpanProcessorCfg returns an instance of QueuedSpanProcessorCfg with default values

func (*QueuedSpanProcessorCfg) InitFromViper

func (qOpts *QueuedSpanProcessorCfg) InitFromViper(v *viper.Viper) *QueuedSpanProcessorCfg

InitFromViper initializes QueuedSpanProcessorCfg with properties from viper

type Receivers

type Receivers map[configmodels.Receiver]*builtReceiver

Receivers is a map of receivers created from receiver configs.

func (Receivers) StartAll

func (rcvs Receivers) StartAll(logger *zap.Logger, host receiver.Host) error

StartAll starts all receivers.

func (Receivers) StopAll

func (rcvs Receivers) StopAll()

StopAll stops all receivers.

type ReceiversBuilder

type ReceiversBuilder struct {
	// contains filtered or unexported fields
}

ReceiversBuilder builds receivers from config.

func NewReceiversBuilder

func NewReceiversBuilder(
	logger *zap.Logger,
	config *configmodels.Config,
	pipelineProcessors PipelineProcessors,
	factories map[string]receiver.Factory,
) *ReceiversBuilder

NewReceiversBuilder creates a new ReceiversBuilder. Call Build() on the returned value.

func (*ReceiversBuilder) Build

func (rb *ReceiversBuilder) Build() (Receivers, error)

Build receivers from config.

type SenderType

type SenderType string

SenderType indicates the type of sender

Jump to

Keyboard shortcuts

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