metricstore

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMON_NAME                         = "metric-store"
	MAX_BATCH_SIZE_IN_BYTES             = 32 * 1024
	MAX_INTERNODE_PAYLOAD_SIZE_IN_BYTES = 2 * MAX_BATCH_SIZE_IN_BYTES
	DEFAULT_EVALUATION_INTERVAL         = (1 * time.Minute)
)

Variables

View Source
var (
	SHA = "dev"
)

Functions

This section is empty.

Types

type MetricStore

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

MetricStore is a persisted store for Loggregator metrics (gauges, timers, counters).

func New

func New(localStore prom_storage.Storage, storagePath string, ingressTLSConfig, internodeTLSServerConfig, internodeTLSClientConfig *tls.Config, egressTLSConfig *config_util.TLSConfig, opts ...MetricStoreOption) *MetricStore

func (*MetricStore) Addr

func (store *MetricStore) Addr() string

Addr returns the address that the MetricStore is listening on. This is only valid after Start has been invoked.

func (*MetricStore) Close

func (store *MetricStore) Close() error

Close will shutdown the servers

func (*MetricStore) IngressAddr

func (store *MetricStore) IngressAddr() string

IngressAddr returns the address that the MetricStore is listening on for ingress. This is only valid after Start has been invoked.

func (*MetricStore) Start

func (store *MetricStore) Start()

Start starts the MetricStore. It has an internal go-routine that it creates and therefore does not block.

type MetricStoreOption

type MetricStoreOption func(*MetricStore)

MetricStoreOption configures a MetricStore.

func WithAddr

func WithAddr(addr string) MetricStoreOption

WithAddr configures the address to listen for API egress requests. It defaults to :8080.

func WithAlertmanagerAddr

func WithAlertmanagerAddr(alertmanagerAddr string) MetricStoreOption

WithAlertmanagerAddr configures the address where an alertmanager is.

func WithClustered

func WithClustered(nodeIndex int, nodeAddrs, internodeAddrs []string) MetricStoreOption

WithClustered enables the MetricStore to route data to peer nodes. It hashes each point by Name and SourceId and routes data that does not belong on the node to the correct node. NodeAddrs is a slice of node addresses where the slice index corresponds to the NodeIndex. The current node's address is included. The default is standalone mode where the MetricStore will store all the data and forward none of it.

func WithExternalAddr

func WithExternalAddr(addr string) MetricStoreOption

WithExternalAddr returns a MetricStoreOption that sets address that peer nodes will refer to the given node as. This is required when the set address won't match what peers will refer to the node as (e.g. :0). Defaults to the resulting address from the listener.

func WithHandoffStoragePath

func WithHandoffStoragePath(handoffStoragePath string) MetricStoreOption

WithHandoffStoragePath sets the base path for storing remote writes that are buffered due to errors.

func WithIngressAddr

func WithIngressAddr(ingressAddr string) MetricStoreOption

WithIngressAddr configures the address to listen for ingress. It defaults to :8090.

func WithInternodeAddr

func WithInternodeAddr(internodeAddr string) MetricStoreOption

WithInternodeAddr configures the address to listen for internode writes. It defaults to :8091.

func WithLogger

func WithLogger(l *logger.Logger) MetricStoreOption

WithLogger returns a MetricStoreOption that configures the logger used for the MetricStore. Defaults to silent logger.

func WithMetrics

func WithMetrics(metrics debug.MetricRegistrar) MetricStoreOption

WithMetrics returns a MetricStoreOption that configures the metrics for the MetricStore. It will add metrics to the given map.

func WithQueryLogger

func WithQueryLogger(path string) MetricStoreOption

func WithQueryTimeout

func WithQueryTimeout(queryTimeout time.Duration) MetricStoreOption

WithQueryTimeout sets the maximum duration of a PromQL query.

func WithReplicationFactor

func WithReplicationFactor(replicationFactor uint) MetricStoreOption

WithReplicationFactor sets the number of nodes that hold a copy of all data.

func WithRulesPath

func WithRulesPath(rulesPath string) MetricStoreOption

WithRulesPath sets the path where configuration for alerting rules can be found

func WithScrapeConfigPath

func WithScrapeConfigPath(scrapeConfigPath string) MetricStoreOption

WithScrapeConfigPath sets the path where configuration for alerting scrapeconfig can be found

Jump to

Keyboard shortcuts

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