Documentation ¶
Index ¶
- Constants
- Variables
- type MetricStore
- type MetricStoreOption
- func WithAddr(addr string) MetricStoreOption
- func WithClustered(nodeIndex int, nodeAddrs, internodeAddrs []string) MetricStoreOption
- func WithConcurrentQueryLimit(maxQueries int) MetricStoreOption
- func WithHandoffStoragePath(handoffStoragePath string) MetricStoreOption
- func WithIngressAddr(ingressAddr string) MetricStoreOption
- func WithInternodeAddr(internodeAddr string) MetricStoreOption
- func WithLogger(l *logger.Logger) MetricStoreOption
- func WithMetrics(metrics metrics.Registrar) MetricStoreOption
- func WithQueryLogging(doLog bool) MetricStoreOption
- func WithQueryTimeout(queryTimeout time.Duration) MetricStoreOption
- func WithReplicationFactor(replicationFactor uint) MetricStoreOption
- func WithScraper(scraper *scraping.Scraper) MetricStoreOption
Constants ¶
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 ¶
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) 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 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 WithConcurrentQueryLimit ¶ added in v1.4.4
func WithConcurrentQueryLimit(maxQueries int) MetricStoreOption
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 metrics.Registrar) MetricStoreOption
WithMetrics returns a MetricStoreOption that configures the metrics for the MetricStore. It will add metrics to the given map.
func WithQueryLogging ¶
func WithQueryLogging(doLog bool) 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 WithScraper ¶
func WithScraper(scraper *scraping.Scraper) MetricStoreOption