metrics

package
v0.0.0-...-a1fe31f Latest Latest
Warning

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

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

Documentation

Overview

Package metrics provides Prometheus metrics for Sesame.

Index

Constants

View Source
const (
	BuildInfoGauge = "Sesame_build_info"

	HTTPProxyTotalGauge     = "Sesame_httpproxy"
	HTTPProxyRootTotalGauge = "Sesame_httpproxy_root"
	HTTPProxyInvalidGauge   = "Sesame_httpproxy_invalid"
	HTTPProxyValidGauge     = "Sesame_httpproxy_valid"
	HTTPProxyOrphanedGauge  = "Sesame_httpproxy_orphaned"

	DAGRebuildGauge = "Sesame_dagrebuild_timestamp"
	DAGRebuildTotal = "Sesame_dagrebuild_total"
)

Variables

This section is empty.

Functions

func Handler

func Handler(registry *prometheus.Registry) http.Handler

Handler returns a http Handler for a metrics endpoint.

Types

type Meta

type Meta struct {
	VHost, Namespace string
}

Meta holds the vhost and namespace of a metric object

type Metrics

type Metrics struct {
	CacheHandlerOnUpdateSummary prometheus.Summary
	EventHandlerOperations      *prometheus.CounterVec
	// contains filtered or unexported fields
}

Metrics provide Prometheus metrics for the app

func NewMetrics

func NewMetrics(registry *prometheus.Registry) *Metrics

NewMetrics creates a new set of metrics and registers them with the supplied registry.

NOTE: when adding new metrics, update Zero() and run `./hack/generate-metrics-doc.go` using `make generate-metrics-docs` to regenerate the metrics documentation.

func (*Metrics) SetDAGLastRebuilt

func (m *Metrics) SetDAGLastRebuilt(ts time.Time)

SetDAGLastRebuilt records the last time the DAG was rebuilt.

func (*Metrics) SetDAGRebuiltTotal

func (m *Metrics) SetDAGRebuiltTotal()

SetDAGRebuiltTotal records the total number of times DAG was rebuilt

func (*Metrics) SetHTTPProxyMetric

func (m *Metrics) SetHTTPProxyMetric(metrics RouteMetric)

SetHTTPProxyMetric sets metric values for a set of HTTPProxies

func (*Metrics) Zero

func (m *Metrics) Zero()

Zero sets zero values for all the registered metrics. This is needed for generating metrics documentation. The prometheus.Registry() won't emit the metric metadata until the metric has been set.

type RouteMetric

type RouteMetric struct {
	Total    map[Meta]int
	Valid    map[Meta]int
	Invalid  map[Meta]int
	Orphaned map[Meta]int
	Root     map[Meta]int
}

RouteMetric stores various metrics for HTTPProxy objects

Jump to

Keyboard shortcuts

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