config

package
v0.0.0-...-81c2c1e Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2018 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentConfig

type AgentConfig struct {
	// Number of threads to be used by the agent process.
	// Should be in the range of [1, runtime.NumCPU()).
	ThreadCount int `mapstructure:"thread_count"`

	// Interval at which to gather information.
	Interval time.Duration `mapstructure:"interval"`

	// CollectionJitter is used to jitter the collection by a random amount.
	// Each plugin will sleep for a random time within jitter before collecting.
	// This can be used to avoid many plugins querying things like sysfs at the
	// same time, which can have a measurable effect on the system.
	CollectionJitter time.Duration `mapstructure:"collection_jitter"`

	// Default flushing interval for all sinks. You shouldn't set this below
	// interval. Maximum flush_interval will be flush_interval + flush_jitter.
	FlushInterval time.Duration `mapstructure:"flush_interval"`

	// FlushJitter Jitters the flush interval by a random amount.
	// This is primarily to avoid large write spikes for users running a large
	// number of Optic instances.
	// ie, a jitter of 5s and interval 10s means flushes will happen every 10-15s
	FlushJitter time.Duration `mapstructure:"flush_jitter"`

	// Override default hostname, if empty use os.Hostname().
	Hostname string `mapstructure:"hostname"`
	// If set to true, do no set the "host" tag in the Optic agent.
	OmitHostname bool `mapstructure:"omit_hostname"`
}

type Config

type Config struct {
	Tags map[string]string `mapstructure:"global_tags"`

	Agent *AgentConfig `mapstructure:"agent"`

	Sources    map[string]*models.RunningSource    `mapstructure:"-"`
	Processors map[string]*models.RunningProcessor `mapstructure:"-"`
	Sinks      map[string]*models.RunningSink      `mapstructure:"-"`
}

Config provides a container with configuration parameters for Optic

func NewConfig

func NewConfig() *Config

func (*Config) GlobalTags

func (c *Config) GlobalTags() string

GlobalTags returns a string of tags specified in the config.

func (*Config) LoadConfig

func (c *Config) LoadConfig(path string) error

LoadConfig loads the given config file and applies it to c.

func (*Config) ProcessorNames

func (c *Config) ProcessorNames() []string

ProcessorNames returns a list of strings of the configured processors.

func (*Config) SinkNames

func (c *Config) SinkNames() []string

SinkNames returns a list of strings of the configured sinks.

func (*Config) SourceNames

func (c *Config) SourceNames() []string

SourceNames returns a list of strings of the configured sources.

Jump to

Keyboard shortcuts

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