metrics

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorStateMetrics

func ErrorStateMetrics(state health.State) string

ErrorStateMetrics is a Prometheus metric meant to show Kuberhealthy has error

func GenerateMetrics

func GenerateMetrics(state health.State) string

GenerateMetrics takes the state and returns it in the Prometheus format

func WriteMetricError

func WriteMetricError(w http.ResponseWriter, state health.State) error

WriteMetricError handles errors in delivering metrics

Types

type Client

type Client interface {
	Push(points Metric, tags map[string]string) error
}

Client is an abstraction for pushing metrics to custom providers

type InfluxClient

type InfluxClient struct {
	// contains filtered or unexported fields
}

InfluxClient defines values needed to push to InfluxDB

func NewInfluxClient

func NewInfluxClient(input InfluxClientInput) (*InfluxClient, error)

NewInfluxClient creates an InfluxClient that can be used to push metrics

func (*InfluxClient) Push

func (i *InfluxClient) Push(points Metric, tags map[string]string) error

Push accepts a list of metrics, with a metric being defined as a map of string (name) to interface (value)

type InfluxClientInput

type InfluxClientInput struct {
	Database string
	Config   InfluxConfig
}

InfluxClientInput defines values needed to push to InfluxDB

type InfluxConfig

type InfluxConfig struct {
	URL              url.URL
	UnixSocket       string
	Username         string
	Password         string
	UserAgent        string
	Timeout          time.Duration
	Precision        string
	WriteConsistency string
	UnsafeSsl        bool
	Proxy            func(req *http.Request) (*url.URL, error)
	TLS              *tls.Config
}

InfluxConfig is cast to an influx.Config object

type Metric

type Metric []map[string]interface{}

Metric is a key value struct

Jump to

Keyboard shortcuts

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