Documentation ¶
Overview ¶
Package metrics handles metrics for the cluster. The library uses Prometheus as the default library but this can be changed by changing the implementation in this package.
Index ¶
Constants ¶
View Source
const ( PrometheusSink = "prometheus" NoSink = "none" )
The list of supported metrics
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClusterInfo ¶ added in v0.0.18
ClusterInfo is the interface to expose cluster info
type Sink ¶
type Sink interface { SetClusterSize(size int) SetShardCount(shards int) SetLogIndex(index uint64) LogRequest(destination, method string) }
Sink is the metrics sink for the cluster. Implement this interface to write to other kinds of systems.
func NewBlackHoleSink ¶
func NewBlackHoleSink() Sink
NewBlackHoleSink creates a metrics sink that discards all metrics
func NewPrometheusSink ¶
func NewPrometheusSink(cluster ClusterInfo) Sink
NewPrometheusSink creates a metrics sink for Prometheus. All sinks created by this function will write to the same sinks.
func NewSinkFromString ¶
func NewSinkFromString(name string, cluster ClusterInfo) Sink
NewSinkFromString returns a named sink
Click to show internal directories.
Click to hide internal directories.