options

package
v0.0.0-...-5561049 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DaemonAndAgentErr = errors.New("cannot set --daemon with --agent")
View Source
var InvalidAgentTypeErr = errors.New("--agent can only be node, cluster, all or legacy")

Functions

This section is empty.

Types

type AgentType

type AgentType string
const (
	AllAgentType     AgentType = "all"
	ClusterAgentType AgentType = "cluster"
	LegacyAgentType  AgentType = "legacy"
	NodeAgentType    AgentType = "node"
)

func NewAgentType

func NewAgentType(value string) (AgentType, error)

func (AgentType) ClusterCollector

func (a AgentType) ClusterCollector() bool

func (AgentType) ScrapeAnyNodes

func (a AgentType) ScrapeAnyNodes() bool

func (AgentType) ScrapeCluster

func (a AgentType) ScrapeCluster() bool

func (AgentType) ScrapeNodes

func (a AgentType) ScrapeNodes() string

func (AgentType) ScrapeOnlyOwnNode

func (a AgentType) ScrapeOnlyOwnNode() bool

func (*AgentType) Set

func (a *AgentType) Set(value string) error

func (AgentType) String

func (a AgentType) String() string

func (AgentType) Type

func (a AgentType) Type() string

type CollectorRunOptions

type CollectorRunOptions struct {
	// supported flags
	Version         bool
	EnableProfiling bool

	AgentType  AgentType
	ConfigFile string
	LogLevel   string
	MaxProcs   int

	// An experimental flag for forcing a garbage collection and releasing memory.
	// See https://utcc.utoronto.ca/~cks/space/blog/programming/GoNoMemoryFreeing for reference.
	// Basically Go holds on to more memory than is necessary resulting in larger heap usage.
	// Enabling this flag causes the collector to call debug.FreeOSMemory after every sink.send() call.
	// Go 1.13 showed a 30% lower memory usage vs Go 1.12. Enabling this flag was observed to result in a further ~30%
	// reduction in memory usage but the impact of forcing a GC run so frequently has not been thoroughly tested.
	ForceGC bool

	// deprecated flags
	MetricResolution      time.Duration
	Sources               flags.Uris
	Sinks                 flags.Uris
	SinkExportDataTimeout time.Duration
	EnableDiscovery       bool
	EnableRuntimeConfigs  bool
	DiscoveryConfigFile   string
	InternalStatsPrefix   string
	ScrapeTimeout         time.Duration
	// contains filtered or unexported fields
}

func NewCollectorRunOptions

func NewCollectorRunOptions() *CollectorRunOptions

func Parse

func Parse() *CollectorRunOptions

func (*CollectorRunOptions) Convert

func (opts *CollectorRunOptions) Convert() (*configuration.Config, error)

Convert converts options into a configuration instance for backwards compatibility

func (*CollectorRunOptions) Parse

func (opts *CollectorRunOptions) Parse(fs *pflag.FlagSet, args []string) error

Jump to

Keyboard shortcuts

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