monitoring

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: Apache-2.0 Imports: 8 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeAlert

func MakeAlert(alertType string, apiKey string) (api.Alert, error)

MakeAlert creates an Alert based on the type of the service (eg Pager Duty) and its corresponding API key.

func MakeMetricsEndpoint

func MakeMetricsEndpoint(path string, metrics Metrics, authLevel networking.AuthLevel) (networking.Endpoint, error)

MakeMetricsEndpoint creates an Endpoint for the monitoring server with the desired auth level. The endpoint's response is always a JSON dump of the provided metrics.

Types

type Metrics

type Metrics interface {
	UpdateMetrics(metrics map[string]interface{})
	MarshalJSON() ([]byte, error)
}

Metrics is an interface that allows a client to pass in key value pairs (keys must be strings) and it can dump the metrics as JSON.

func MakeMetricsRecorder

func MakeMetricsRecorder(records map[string]interface{}) (Metrics, error)

MakeMetricsRecorder makes a metrics recorder with the records map as the underlying map. If records is nil, then an empty map will be initialized for you.

Jump to

Keyboard shortcuts

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