config

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2019 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatorConfiguration

type AggregatorConfiguration struct {
	// HostID is the local host ID configuration.
	HostID *hostid.Configuration `yaml:"hostID"`

	// InstanceID is the instance ID configuration.
	InstanceID InstanceIDConfiguration `yaml:"instanceID"`

	// AggregationTypes configs the aggregation types.
	AggregationTypes aggregation.TypesConfiguration `yaml:"aggregationTypes"`

	// Common metric prefix.
	MetricPrefix *string `yaml:"metricPrefix"`

	// Counter metric prefix.
	CounterPrefix *string `yaml:"counterPrefix"`

	// Timer metric prefix.
	TimerPrefix *string `yaml:"timerPrefix"`

	// Gauge metric prefix.
	GaugePrefix *string `yaml:"gaugePrefix"`

	// Stream configuration for computing quantiles.
	Stream streamConfiguration `yaml:"stream"`

	// Client configuration.
	Client aggclient.Configuration `yaml:"client"`

	// Placement manager.
	PlacementManager placementManagerConfiguration `yaml:"placementManager"`

	// Hash type used for sharding.
	HashType *sharding.HashType `yaml:"hashType"`

	// Amount of time we buffer writes before shard cutover.
	BufferDurationBeforeShardCutover time.Duration `yaml:"bufferDurationBeforeShardCutover"`

	// Amount of time we buffer writes after shard cutoff.
	BufferDurationAfterShardCutoff time.Duration `yaml:"bufferDurationAfterShardCutoff"`

	// Amount of time we buffer timed metrics in the past.
	BufferDurationForPastTimedMetric time.Duration `yaml:"bufferDurationForPastTimedMetric"`

	// Amount of time we buffer timed metrics in the future.
	BufferDurationForFutureTimedMetric time.Duration `yaml:"bufferDurationForFutureTimedMetric"`

	// Resign timeout.
	ResignTimeout time.Duration `yaml:"resignTimeout"`

	// Flush times manager.
	FlushTimesManager flushTimesManagerConfiguration `yaml:"flushTimesManager"`

	// Election manager.
	ElectionManager electionManagerConfiguration `yaml:"electionManager"`

	// Flush manager.
	FlushManager flushManagerConfiguration `yaml:"flushManager"`

	// Flushing handler configuration.
	Flush handler.FlushHandlerConfiguration `yaml:"flush"`

	// Forwarding configuration.
	Forwarding forwardingConfiguration `yaml:"forwarding"`

	// EntryTTL determines how long an entry remains alive before it may be expired due to inactivity.
	EntryTTL time.Duration `yaml:"entryTTL"`

	// EntryCheckInterval determines how often entries are checked for expiration.
	EntryCheckInterval time.Duration `yaml:"entryCheckInterval"`

	// EntryCheckBatchPercent determines the percentage of entries checked in a batch.
	EntryCheckBatchPercent float64 `yaml:"entryCheckBatchPercent" validate:"min=0.0,max=1.0"`

	// MaxTimerBatchSizePerWrite determines the maximum timer batch size for each batched write.
	MaxTimerBatchSizePerWrite int `yaml:"maxTimerBatchSizePerWrite" validate:"min=0"`

	// Default storage policies.
	DefaultStoragePolicies []policy.StoragePolicy `yaml:"defaultStoragePolicies" validate:"nonzero"`

	// Maximum number of cached source sets.
	MaxNumCachedSourceSets *int `yaml:"maxNumCachedSourceSets"`

	// Whether to discard NaN aggregated values.
	DiscardNaNAggregatedValues *bool `yaml:"discardNaNAggregatedValues"`

	// Pool of counter elements.
	CounterElemPool pool.ObjectPoolConfiguration `yaml:"counterElemPool"`

	// Pool of timer elements.
	TimerElemPool pool.ObjectPoolConfiguration `yaml:"timerElemPool"`

	// Pool of gauge elements.
	GaugeElemPool pool.ObjectPoolConfiguration `yaml:"gaugeElemPool"`

	// Pool of entries.
	EntryPool pool.ObjectPoolConfiguration `yaml:"entryPool"`
}

AggregatorConfiguration contains aggregator configuration.

func (*AggregatorConfiguration) NewAggregatorOptions

func (c *AggregatorConfiguration) NewAggregatorOptions(
	address string,
	client client.Client,
	runtimeOptsManager aggruntime.OptionsManager,
	instrumentOpts instrument.Options,
) (aggregator.Options, error)

NewAggregatorOptions creates a new set of aggregator options.

type Configuration

type Configuration struct {
	// Logging configuration.
	Logging log.Configuration `yaml:"logging"`

	// Metrics configuration.
	Metrics instrument.MetricsConfiguration `yaml:"metrics"`

	// Raw TCP server configuration.
	RawTCP RawTCPServerConfiguration `yaml:"rawtcp"`

	// HTTP server configuration.
	HTTP HTTPServerConfiguration `yaml:"http"`

	// Client configuration for key value store.
	KVClient KVClientConfiguration `yaml:"kvClient" validate:"nonzero"`

	// Runtime options configuration.
	RuntimeOptions RuntimeOptionsConfiguration `yaml:"runtimeOptions"`

	// Aggregator configuration.
	Aggregator AggregatorConfiguration `yaml:"aggregator"`
}

Configuration contains top-level configuration.

type HTTPServerConfiguration

type HTTPServerConfiguration struct {
	// HTTP server listening address.
	ListenAddress string `yaml:"listenAddress" validate:"nonzero"`

	// HTTP server read timeout.
	ReadTimeout time.Duration `yaml:"readTimeout"`

	// HTTP server write timeout.
	WriteTimeout time.Duration `yaml:"writeTimeout"`
}

HTTPServerConfiguration contains http server configuration.

func (*HTTPServerConfiguration) NewServerOptions

func (c *HTTPServerConfiguration) NewServerOptions() http.Options

NewServerOptions create a new set of http server options.

type InstanceIDConfiguration added in v0.14.2

type InstanceIDConfiguration struct {
	// InstanceIDType specifies how to construct the instance ID
	// that is used for lookup of the aggregator in the placement.
	InstanceIDType InstanceIDType `yaml:"type"`
}

InstanceIDConfiguration is the instance ID configuration.

type InstanceIDType added in v0.14.2

type InstanceIDType uint

InstanceIDType is the instance ID type that defines how the instance ID is constructed, which is then used to lookup the aggregator instance in the placement.

const (
	// HostIDPortInstanceIDType specifies to use the host ID
	// concatenated with the port to be used for lookup
	// in the placement.
	// NB: this is a legacy instance ID type and is how the instance
	// ID used to be constructed which imposed the strange
	// requirement that the instance ID in the topology used to require
	// the port concat'd with the host ID).
	HostIDPortInstanceIDType InstanceIDType = iota
	// HostIDInstanceIDType specifies to just use the host ID
	// as the instance ID for lookup in the placement.
	HostIDInstanceIDType
)

func (InstanceIDType) String added in v0.14.2

func (t InstanceIDType) String() string

func (*InstanceIDType) UnmarshalYAML added in v0.14.2

func (t *InstanceIDType) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a InstanceIDType into a valid type from string.

type KVClientConfiguration

type KVClientConfiguration struct {
	Etcd *etcdclient.Configuration `yaml:"etcd"`
}

KVClientConfiguration configures the client for the key-value store. TODO(xichen): add configuration for in-memory client with pre-populated data for different namespaces so we can start up m3aggregator without a real etcd cluster.

func (*KVClientConfiguration) NewKVClient

func (c *KVClientConfiguration) NewKVClient(
	instrumentOpts instrument.Options,
) (client.Client, error)

NewKVClient creates a new KV client.

type RawTCPServerConfiguration

type RawTCPServerConfiguration struct {
	// Raw TCP server listening address.
	ListenAddress string `yaml:"listenAddress" validate:"nonzero"`

	// Error log limit per second.
	ErrorLogLimitPerSecond *int64 `yaml:"errorLogLimitPerSecond"`

	// Whether keep alives are enabled on connections.
	KeepAliveEnabled *bool `yaml:"keepAliveEnabled"`

	// KeepAlive period.
	KeepAlivePeriod *time.Duration `yaml:"keepAlivePeriod"`

	// Retry mechanism configuration.
	Retry retry.Configuration `yaml:"retry"`

	// Read buffer size.
	ReadBufferSize *int `yaml:"readBufferSize"`

	// Msgpack iterator configuration.
	MsgpackIterator msgpackUnaggregatedIteratorConfiguration `yaml:"msgpackIterator"`

	// Protobuf iterator configuration.
	ProtobufIterator protobufUnaggregatedIteratorConfiguration `yaml:"protobufIterator"`
}

RawTCPServerConfiguration contains raw TCP server configuration.

func (*RawTCPServerConfiguration) NewServerOptions

func (c *RawTCPServerConfiguration) NewServerOptions(
	instrumentOpts instrument.Options,
) rawtcp.Options

NewServerOptions create a new set of raw TCP server options.

type RuntimeOptionsConfiguration

type RuntimeOptionsConfiguration struct {
	KVConfig                               kv.OverrideConfiguration `yaml:"kvConfig"`
	WriteValuesPerMetricLimitPerSecondKey  string                   `yaml:"writeValuesPerMetricLimitPerSecondKey" validate:"nonzero"`
	WriteValuesPerMetricLimitPerSecond     int64                    `yaml:"writeValuesPerMetricLimitPerSecond"`
	WriteNewMetricLimitClusterPerSecondKey string                   `yaml:"writeNewMetricLimitClusterPerSecondKey" validate:"nonzero"`
	WriteNewMetricLimitClusterPerSecond    int64                    `yaml:"writeNewMetricLimitClusterPerSecond"`
	WriteNewMetricNoLimitWarmupDuration    time.Duration            `yaml:"writeNewMetricNoLimitWarmupDuration"`
}

RuntimeOptionsConfiguration configures runtime options.

func (RuntimeOptionsConfiguration) NewRuntimeOptionsManager

func (c RuntimeOptionsConfiguration) NewRuntimeOptionsManager() runtime.OptionsManager

NewRuntimeOptionsManager creates a new runtime options manager.

func (RuntimeOptionsConfiguration) WatchRuntimeOptionChanges

func (c RuntimeOptionsConfiguration) WatchRuntimeOptionChanges(
	client client.Client,
	runtimeOptsManager runtime.OptionsManager,
	placementManager aggregator.PlacementManager,
	logger *zap.Logger,
)

WatchRuntimeOptionChanges watches runtime option updates.

Jump to

Keyboard shortcuts

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