metricstore

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COMMON_NAME                 = "metric-store"
	MAX_HASH                    = math.MaxUint64
	DEFAULT_EVALUATION_INTERVAL = (1 * time.Minute)
)

Variables

This section is empty.

Functions

func EngineQueryFunc added in v1.2.1

func EngineQueryFunc(engine *promql.Engine, q storage.Queryable) rules.QueryFunc

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(persistentStore storage.Storage, egressTLSConfig, ingressTLSConfig *tls.Config, 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 gRPC server

func (*MetricStore) IngressAddr added in v1.2.1

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 gRPC requests. It defaults to :8080.

func WithAlertmanagerAddr added in v1.2.1

func WithAlertmanagerAddr(alertmanagerAddr string) MetricStoreOption

WithAlertmanagerAddr configures the address where an alertmanager is.

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 WithIngressAddr added in v1.2.1

func WithIngressAddr(ingressAddr string) MetricStoreOption

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

func WithLogger

func WithLogger(log *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 WithQueryTimeout

func WithQueryTimeout(queryTimeout time.Duration) MetricStoreOption

WithQueryTimeout sets the maximum duration of a PromQL query.

func WithRulesPath added in v1.2.1

func WithRulesPath(rulesPath string) MetricStoreOption

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

Jump to

Keyboard shortcuts

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