Documentation ¶
Index ¶
- Constants
- func EngineQueryFunc(engine *promql.Engine, q storage.Queryable) rules.QueryFunc
- type MetricStore
- type MetricStoreOption
- func WithAddr(addr string) MetricStoreOption
- func WithAlertmanagerAddr(alertmanagerAddr string) MetricStoreOption
- func WithExternalAddr(addr string) MetricStoreOption
- func WithIngressAddr(ingressAddr string) MetricStoreOption
- func WithLogger(log *logger.Logger) MetricStoreOption
- func WithMetrics(metrics debug.MetricRegistrar) MetricStoreOption
- func WithQueryTimeout(queryTimeout time.Duration) MetricStoreOption
- func WithRulesPath(rulesPath string) MetricStoreOption
Constants ¶
const ( COMMON_NAME = "metric-store" MAX_HASH = math.MaxUint64 DEFAULT_EVALUATION_INTERVAL = (1 * time.Minute) )
Variables ¶
This section is empty.
Functions ¶
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