metrics

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 1 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 Sink

type Sink interface {
	SetClusterSize(nodeid string, size int)
	SetShardCount(nodeid string, shards int)
	SetShardIndex(nodeid string, index uint64)
	LogRequest(nodeid, 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() 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) Sink

NewSinkFromString returns a named sink

Jump to

Keyboard shortcuts

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