config

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 35 Imported by: 14

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ForwardTo

type ForwardTo struct {
	URL                  *string `json:",omitempty"`
	EventURL             *string `json:",omitempty"`
	TraceURL             *string `json:",omitempty"`
	Host                 *string `json:",omitempty"`
	Port                 *uint16 `json:",omitempty"`
	Type                 string
	TimeoutDuration      *time.Duration              `json:"-"`
	Timeout              *string                     `json:",omitempty"`
	DefaultSource        *string                     `json:",omitempty"`
	DefaultAuthToken     *string                     `json:",omitempty"`
	UseAuthFromRequest   *bool                       `json:",omitempty"`
	AuthTokenEnvVar      *string                     `json:",omitempty"`
	BufferSize           *int64                      `json:",omitempty"`
	Name                 *string                     `json:",omitempty"`
	DrainingThreads      *int64                      `json:",omitempty"`
	MetricCreationURL    *string                     `json:",omitempty"`
	MaxDrainSize         *int64                      `json:",omitempty"`
	Filename             *string                     `json:",omitempty"`
	SourceDimensions     *string                     `json:",omitempty"`
	FormatVersion        *uint32                     `json:",omitempty"`
	DimensionsOrder      []string                    `json:",omitempty"`
	Filters              *filtering.FilterObj        `json:",omitempty"`
	TraceSample          *sampling.SmartSampleConfig `json:",omitempty"`
	TraceDistributor     *sampling.SmartSampleConfig `json:",omitempty"`
	AdditionalDimensions map[string]string           `json:",omitempty"`
	DisableCompression   *bool                       `json:",omitempty"`
	Client               etcdIntf.Client             `json:"-"`
	ClusterName          *string                     `json:"-"`
	Idx                  int                         `json:"-"`
}

ForwardTo configures where we forward datapoints to

func (*ForwardTo) String

func (forwardTo *ForwardTo) String() string

type GatewayConfig added in v1.0.1

type GatewayConfig struct {
	// General Gateway Configurations
	NumProcs             *int              `json:",omitempty"`
	PidFilename          *string           `json:",omitempty"`
	AdditionalDimensions map[string]string `json:",omitempty"`

	// forwarder Configuration
	ForwardTo []*ForwardTo `json:",omitempty"`

	// Listener Configurations
	ListenFrom              []*ListenFrom  `json:",omitempty"`
	LateThreshold           *string        `json:",omitempty"`
	FutureThreshold         *string        `json:",omitempty"`
	LateThresholdDuration   *time.Duration `json:"-"`
	FutureThresholdDuration *time.Duration `json:"-"`

	// Log configurations
	LogDir        *string `json:",omitempty"`
	LogMaxSize    *int    `json:",omitempty"`
	LogMaxBackups *int    `json:",omitempty"`
	LogFormat     *string `json:",omitempty"`

	// Internal Metric Configurations
	StatsDelay                     *string        `json:",omitempty"`
	StatsDelayDuration             *time.Duration `json:"-"`
	InternalMetricsListenerAddress *string        `json:",omitempty"`

	// Debug Configurations
	LocalDebugServer *string `json:",omitempty"`
	PprofAddr        *string `json:",omitempty"`
	DebugFlag        *string `json:",omitempty"`

	// Shutdown Configurations
	MaxGracefulWaitTime           *string        `json:",omitempty"`
	GracefulCheckInterval         *string        `json:",omitempty"`
	SilentGracefulTime            *string        `json:",omitempty"`
	MaxGracefulWaitTimeDuration   *time.Duration `json:"-"`
	GracefulCheckIntervalDuration *time.Duration `json:"-"`
	SilentGracefulTimeDuration    *time.Duration `json:"-"`

	// General Cluster configurations
	ServerName       *string `json:",omitempty"`
	ClusterName      *string `json:",omitempty"`
	ClusterOperation *string `json:",omitempty"`
	ClusterDataDir   *string `json:",omitempty"`

	// Target Cluster Addresses
	TargetClusterAddresses []string `json:",omitempty"`

	// Peer Addresses
	AdvertisedPeerAddresses []string `json:",omitempty"`
	AdvertisePeerAddress    *string  `json:",omitempty"`
	ListenOnPeerAddresses   []string `json:",omitempty"`
	ListenOnPeerAddress     *string  `json:",omitempty"`

	// Client Addresses
	AdvertisedClientAddresses []string `json:",omitempty"`
	AdvertiseClientAddress    *string  `json:",omitempty"`
	ListenOnClientAddresses   []string `json:",omitempty"`
	ListenOnClientAddress     *string  `json:",omitempty"`

	// Metric Addresses for Etcd
	EtcdListenOnMetricsAddresses []string `json:",omitempty"`
	ETCDMetricsAddress           *string  `json:",omitempty"`

	// Durations
	UnhealthyMemberTTL     *time.Duration `json:"-"`
	RemoveMemberTimeout    *time.Duration `json:"-"`
	EtcdServerStartTimeout *time.Duration `json:"-"`

	// Etcd Configurable Durations
	EtcdDialTimeout            *time.Duration `json:"-"`
	EtcdAutoSyncInterval       *time.Duration `json:"-"`
	EtcdStartupGracePeriod     *time.Duration `json:"-"`
	EtcdClusterCleanUpInterval *time.Duration `json:"-"`
	EtcdHeartBeatInterval      *time.Duration `json:"-"` // maps to TickMs
	EtcdElectionTimeout        *time.Duration `json:"-"` // maps to ElectionMs this should be 10x TickMS https://github.com/etcd-io/etcd/blob/release-3.3/Documentation/tuning.md

	// Etcd configurable file limits
	EtcdSnapCount    *uint64 `json:",omitempty"`
	EtcdMaxSnapFiles *uint   `json:",omitempty"`
	EtcdMaxWalFiles  *uint   `json:",omitempty"`

	EmitDebugMetrics *bool `json:",omitempty"` // indicates whether debug metrics should be emitted or not
}

GatewayConfig is the full config as presented inside the gateway config file

func DefaultGatewayConfig added in v1.0.1

func DefaultGatewayConfig() *GatewayConfig

DefaultGatewayConfig returns default gateway config

func Load

func Load(configFile string, logger log.Logger) (*GatewayConfig, error)

Load loads gateway configuration from a filename that is in an xdg configuration location

func (*GatewayConfig) String added in v1.0.1

func (p *GatewayConfig) String() string

func (*GatewayConfig) ToEtcdConfig added in v1.0.19

func (p *GatewayConfig) ToEtcdConfig() *embetcd.Config

ToEtcdConfig returns a config struct for github.com/signalfx/embetcd/embetcd

func (*GatewayConfig) Var added in v1.0.1

func (p *GatewayConfig) Var() expvar.Var

Var returns the gateway config itself as an expvar

type ListenFrom

type ListenFrom struct {
	Type                               string
	ListenAddr                         *string                               `json:",omitempty"`
	Dimensions                         map[string]string                     `json:",omitempty"`
	MetricDeconstructor                *string                               `json:",omitempty"`
	MetricDeconstructorOptions         *string                               `json:",omitempty"`
	MetricDeconstructorOptionsJSON     map[string]interface{}                `json:",omitempty"`
	Timeout                            *string                               `json:",omitempty"`
	Name                               *string                               `json:",omitempty"`
	ListenPath                         *string                               `json:",omitempty"`
	JSONEngine                         *string                               `json:",omitempty"`
	Encrypted                          *bool                                 `json:",omitempty"`
	Protocol                           *string                               `json:",omitempty"`
	TimeoutDuration                    *time.Duration                        `json:"-"`
	ServerAcceptDeadline               *time.Duration                        `json:"-"`
	SpanNameReplacementRules           []string                              `json:",omitempty"`
	SpanNameReplacementBreakAfterMatch *bool                                 `json:",omitempty"`
	AdditionalSpanTags                 map[string]string                     `json:",omitempty"`
	RemoveSpanTags                     []*spanobfuscation.TagMatchRuleConfig `json:",omitempty"`
	ObfuscateSpanTags                  []*spanobfuscation.TagMatchRuleConfig `json:",omitempty"`
	Counter                            *dpsink.Counter                       `json:"-"`
}

ListenFrom configures how we listen for datapoints to forward

func (*ListenFrom) String

func (listenFrom *ListenFrom) String() string

type Loader added in v0.9.0

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

Loader is able to load forwarders and listeners from config type strings

func NewLoader added in v0.9.0

func NewLoader(ctx context.Context, logger log.Logger, version string, debugContext *web.HeaderCtxFlag, itemFlagger *dpsink.ItemFlagger, ctxdims *log.CtxDimensions, next web.NextConstructor) *Loader

NewLoader creates the default loader for gateway protocols

func (*Loader) Forwarder added in v0.9.0

func (l *Loader) Forwarder(conf *ForwardTo) (protocol.Forwarder, error)

Forwarder loads a forwarder based upon config, finding the right forwarder first

func (*Loader) Listener added in v0.9.0

func (l *Loader) Listener(sink signalfx.Sink, conf *ListenFrom) (protocol.Listener, error)

Listener loads a listener based upon config, finding the right listener first

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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