monitoring

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Livez

func Livez(c echo.Context) error

Livez checks if the api is healthy

Types

type Metric

type Metric struct {
	MetricCollector prometheus.Collector
	ID              string
	Name            string
	Description     string
	Type            string
	Args            []string
}

Metric is a definition for the name, description, type, ID, and prometheus.Collector type (i.e. CounterVec, HistrogramVec, etc) of each metric

type Metrics

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

Metrics contains the metrics gathered by the instance and its path

func NewMetrics

func NewMetrics(subsystem string, skipper middleware.Skipper, isUnitTest bool) *Metrics

NewMetrics generates a new set of metrics with a certain subsystem name

func (*Metrics) RecordEgressRequestCnt

func (m *Metrics) RecordEgressRequestCnt(target string)

RecordEgressRequestCnt increases the Egress counter for a taget

func (*Metrics) RecordEgressRequestDur

func (m *Metrics) RecordEgressRequestDur(target string, elapsed float64)

RecordEgressRequestDur registers the Egress duration for a taget

func (*Metrics) RecordIngressRequestCnt

func (m *Metrics) RecordIngressRequestCnt(code, method, url string)

RecordIngressRequestCnt increases the Ingress counter for a taget

func (*Metrics) RecordIngressRequestDur

func (m *Metrics) RecordIngressRequestDur(code, method, url string, elapsed float64)

RecordIngressRequestDur registers the Egress duration for a taget

func (*Metrics) Use

func (m *Metrics) Use(e *echo.Echo)

Use adds the middleware to the Echo engine.

type MetricsI

type MetricsI interface {
	RecordEgressRequestCnt(target string)
	RecordEgressRequestDur(target string, elapsed float64)
	RecordIngressRequestCnt(code, method, url string)
	RecordIngressRequestDur(code, method, url string, elapsed float64)
	Use(e *echo.Echo)
}

MetricsI interface

Jump to

Keyboard shortcuts

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