flags

package
v1.45.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

View Source
const (

	// DefaultNumWorkers is the default number of workers consuming from the processor queue
	DefaultNumWorkers = 50
	// DefaultQueueSize is the size of the processor's queue
	DefaultQueueSize = 2000
	// DefaultGRPCMaxReceiveMessageLength is the default max receivable message size for the gRPC Collector
	DefaultGRPCMaxReceiveMessageLength = 4 * 1024 * 1024
)

Variables

This section is empty.

Functions

func AddFlags

func AddFlags(flags *flag.FlagSet)

AddFlags adds flags for CollectorOptions

Types

type CollectorOptions

type CollectorOptions struct {
	// DynQueueSizeMemory determines how much memory to use for the queue
	DynQueueSizeMemory uint
	// QueueSize is the size of collector's queue
	QueueSize int
	// NumWorkers is the number of internal workers in a collector
	NumWorkers int
	// HTTP section defines options for HTTP server
	HTTP HTTPOptions
	// GRPC section defines options for gRPC server
	GRPC GRPCOptions
	// OTLP section defines options for servers accepting OpenTelemetry OTLP format
	OTLP struct {
		Enabled bool
		GRPC    GRPCOptions
		HTTP    HTTPOptions
	}
	// Zipkin section defines options for Zipkin HTTP server
	Zipkin struct {
		// HTTPHostPort is the host:port address that the Zipkin collector service listens in on for http requests
		HTTPHostPort string
		// ZipkinAllowedOrigins is a list of origins a cross-domain request to the Zipkin collector service can be executed from
		AllowedOrigins string
		// ZipkinAllowedHeaders is a list of headers that the Zipkin collector service allowes the client to use with cross-domain requests
		AllowedHeaders string
		// TLS configures secure transport for Zipkin endpoint to collect spans
		TLS tlscfg.Options
		// KeepAlive configures allow Keep-Alive for Zipkin HTTP server
		KeepAlive bool
	}
	// CollectorTags is the string representing collector tags to append to each and every span
	CollectorTags map[string]string
	// SpanSizeMetricsEnabled determines whether to enable metrics based on processed span size
	SpanSizeMetricsEnabled bool
}

CollectorOptions holds configuration for collector

func (*CollectorOptions) InitFromViper

func (cOpts *CollectorOptions) InitFromViper(v *viper.Viper, logger *zap.Logger) (*CollectorOptions, error)

InitFromViper initializes CollectorOptions with properties from viper

type GRPCOptions

type GRPCOptions struct {
	// HostPort is the host:port address that the collector service listens in on for gRPC requests
	HostPort string
	// TLS configures secure transport for gRPC endpoint to collect spans
	TLS tlscfg.Options
	// MaxReceiveMessageLength is the maximum message size receivable by the gRPC Collector.
	MaxReceiveMessageLength int
	// MaxConnectionAge is a duration for the maximum amount of time a connection may exist.
	// See gRPC's keepalive.ServerParameters#MaxConnectionAge.
	MaxConnectionAge time.Duration
	// MaxConnectionAgeGrace is an additive period after MaxConnectionAge after which the connection will be forcibly closed.
	// See gRPC's keepalive.ServerParameters#MaxConnectionAgeGrace.
	MaxConnectionAgeGrace time.Duration
	// Tenancy configures tenancy for endpoints that collect spans
	Tenancy tenancy.Options
}

GRPCOptions defines options for a gRPC server

type HTTPOptions

type HTTPOptions struct {
	// HostPort is the host:port address that the server listens on
	HostPort string
	// TLS configures secure transport for HTTP endpoint
	TLS tlscfg.Options
	// ReadTimeout sets the respective parameter of http.Server
	ReadTimeout time.Duration
	// ReadHeaderTimeout sets the respective parameter of http.Server
	ReadHeaderTimeout time.Duration
	// IdleTimeout sets the respective parameter of http.Server
	IdleTimeout time.Duration
}

HTTPOptions defines options for an HTTP server

Jump to

Keyboard shortcuts

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