app

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addr                  string        `env:"ADDR, required, report"`
	IngressAddr           string        `env:"INGRESS_ADDR, required, report"`
	InternodeAddr         string        `env:"INTERNODE_ADDR, required, report"`
	MetricsAddr           string        `env:"METRICS_ADDR, report"`
	StoragePath           string        `env:"STORAGE_PATH, report"`
	RetentionPeriodInDays uint          `env:"RETENTION_PERIOD_IN_DAYS, report"`
	RetentionPeriod       time.Duration `env:"-, report"`
	DiskFreePercentTarget uint          `env:"DISK_FREE_PERCENT_TARGET, report"`
	ReplicationFactor     uint          `env:"REPLICATION_FACTOR, report"`
	LabelTruncationLength uint          `env:"LABEL_TRUNCATION_LENGTH, report"`
	QueryTimeout          time.Duration `env:"QUERY_TIMEOUT, report"`

	// NodeIndex determines what data the node stores. It splits up the range
	// of 0 - 18446744073709551615 evenly. If data falls out of range of the
	// given node, it will be routed to theh correct one.
	NodeIndex int `env:"NODE_INDEX, report"`

	// NodeAddrs are all the MetricStore addresses (including the current
	// address). They are in order according to their NodeIndex.
	//
	// If NodeAddrs is emptpy or size 1, then data is not routed as it is
	// assumed that the current node is the only one.
	NodeAddrs []string `env:"NODE_ADDRS, report"`

	// InternodeAddrs are all the internode addresses (including the current
	// address). They are in order according to their NodeIndex.
	//
	// If InternodeAddrs is emptpy or size 1, then data is not routed as it is
	// assumed that the current node is the only one.
	InternodeAddrs []string `env:"INTERNODE_ADDRS, report"`

	TLS                     sharedtls.TLS
	MetricStoreServerTLS    MetricStoreServerTLS
	MetricStoreInternodeTLS MetricStoreInternodeTLS
	MetricStoreMetricsTLS   MetricStoreMetricsTLS

	ScrapeConfigPath          string `env:"SCRAPE_CONFIG_PATH, report"`
	AdditionalScrapeConfigDir string `env:"ADDITIONAL_SCRAPE_CONFIGS_DIR, report"`

	LogLevel             string `env:"LOG_LEVEL, report"`
	ProfilingAddr        string `env:"PROFILING_ADDR, report"`
	LogQueries           bool   `env:"LOG_QUERIES, report"`
	MaxConcurrentQueries int    `env:"MAX_CONCURRENT_QUERIES, report"`
}

Config is the configuration for a MetricStore.

func LoadConfig

func LoadConfig() *Config

TODO decide between required env vars and defaults LoadConfig creates Config object from environment variables

type MetricStoreApp

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

func NewMetricStoreApp

func NewMetricStoreApp(cfg *Config, log *logger.Logger) *MetricStoreApp

func (*MetricStoreApp) MetricsAddr added in v1.4.3

func (app *MetricStoreApp) MetricsAddr() string

func (*MetricStoreApp) ProfilingAddr added in v1.4.3

func (app *MetricStoreApp) ProfilingAddr() string

func (*MetricStoreApp) Run

func (app *MetricStoreApp) Run()

Run starts the Metric Store, this is a blocking method call.

func (*MetricStoreApp) Stop

func (app *MetricStoreApp) Stop()

Stop stops all the subprocesses for the application.

type MetricStoreInternodeTLS added in v1.3.0

type MetricStoreInternodeTLS struct {
	CAPath   string `env:"METRIC_STORE_INTERNODE_CA_PATH, required, report"`
	CertPath string `env:"METRIC_STORE_INTERNODE_CERT_PATH, required, report"`
	KeyPath  string `env:"METRIC_STORE_INTERNODE_KEY_PATH, required, report"`
}

type MetricStoreMetricsTLS added in v1.3.0

type MetricStoreMetricsTLS struct {
	CAPath   string `env:"METRIC_STORE_METRICS_CA_PATH, required, report"`
	CertPath string `env:"METRIC_STORE_METRICS_CERT_PATH, required, report"`
	KeyPath  string `env:"METRIC_STORE_METRICS_KEY_PATH, required, report"`
}

type MetricStoreServerTLS

type MetricStoreServerTLS struct {
	CAPath   string `env:"METRIC_STORE_SERVER_CA_PATH, required, report"`
	CertPath string `env:"METRIC_STORE_SERVER_CERT_PATH, required, report"`
	KeyPath  string `env:"METRIC_STORE_SERVER_KEY_PATH, required, report"`
}

Jump to

Keyboard shortcuts

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