metrics

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

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

type ClusterInfo interface {
	Created() time.Time
	NodeID() string
}

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

Jump to

Keyboard shortcuts

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