config

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultStartupDelay       = time.Minute
	DefaultWALDirectory       = "data/wal"
	DefaultAdminListenAddress = "0.0.0.0:9091"
	DefaultPrometheusEndpoint = "http://127.0.0.1:9090/"
	DefaultMaxPointAge        = time.Hour * 25
	DefaultExportTimeout      = time.Second * 60
	DefaultReportingPeriod    = time.Second * 30
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminConfig

type AdminConfig struct {
	ListenAddress string `json:"listen_address"`
}

type DurationConfig

type DurationConfig struct {
	time.Duration `json:"duration" yaml:"-,inline"`
}

func (DurationConfig) MarshalJSON

func (d DurationConfig) MarshalJSON() ([]byte, error)

func (*DurationConfig) UnmarshalJSON

func (d *DurationConfig) UnmarshalJSON(data []byte) error

type FileReadFunc

type FileReadFunc func(filename string) ([]byte, error)

type LogConfig

type LogConfig struct {
	Level   string `json:"level"`
	Format  string `json:"format"`
	Verbose int    `json:"verbose"`
}

type MainConfig

type MainConfig struct {
	Destination    OTLPConfig             `json:"destination"`
	Prometheus     PromConfig             `json:"prometheus"`
	OpenTelemetry  OTelConfig             `json:"opentelemetry"`
	Admin          AdminConfig            `json:"admin"`
	Security       SecurityConfig         `json:"security"`
	Diagnostics    OTLPConfig             `json:"diagnostics"`
	StartupDelay   DurationConfig         `json:"startup_delay"`
	Filters        []string               `json:"filters"`
	MetricRenames  []MetricRenamesConfig  `json:"metric_renames"`
	StaticMetadata []StaticMetadataConfig `json:"static_metadata"`
	LogConfig      LogConfig              `json:"log_config"`

	// This field cannot be parsed inside a configuration file,
	// only can be set by command-line flag.:
	ConfigFilename string `json:"-" yaml:"-"`
}

func Configure

func Configure(args []string, readFunc FileReadFunc) (MainConfig, map[string]string, []*metadata.Entry, error)

Configure is a separate unit of code for testing purposes.

func DefaultMainConfig

func DefaultMainConfig() MainConfig

type MetricRenamesConfig

type MetricRenamesConfig struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type OTLPConfig

type OTLPConfig struct {
	Endpoint   string            `json:"endpoint"`
	Headers    map[string]string `json:"headers"`
	Attributes map[string]string `json:"attributes"`
	Timeout    DurationConfig    `json:"timeout"`
}

type OTelConfig

type OTelConfig struct {
	MetricsPrefix string `json:"metrics_prefix"`
	UseMetaLabels bool   `json:"use_meta_labels"`
}

type PromConfig

type PromConfig struct {
	Endpoint    string         `json:"endpoint"`
	WAL         string         `json:"wal"`
	MaxPointAge DurationConfig `json:"max_point_age"`
}

type SecurityConfig

type SecurityConfig struct {
	RootCertificates []string `json:"root_certificates"`
}

type StaticMetadataConfig

type StaticMetadataConfig struct {
	Metric    string `json:"metric"`
	Type      string `json:"type"`
	ValueType string `json:"value_type"`
	Help      string `json:"help"`
}

Jump to

Keyboard shortcuts

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