metricsstore

package
v0.0.0-...-4b75dde Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package metricsstore implements a Prometheus metrics store for OSM's control plane metrics.

Index

Constants

This section is empty.

Variables

View Source
var DefaultMetricsStore = &defaultMetricsStore

DefaultMetricsStore is the default metrics store

Functions

func AddHTTPMetrics

func AddHTTPMetrics(h http.Handler) http.Handler

AddHTTPMetrics wraps the given handler with one that tracks HTTP metrics for response counts and durations

Types

type MetricsStore

type MetricsStore struct {

	/*
	 * K8s metrics
	 */
	// K8sAPIEventCounter is the metric counter for the number of K8s API events
	K8sAPIEventCounter *prometheus.CounterVec

	/*
	 * Resource metrics
	 */
	// MonitoredNamespaceCounter is the metric counter for the total number of monitored namespaces in the mesh
	MonitoredNamespaceCounter prometheus.Gauge

	/*
	 * Proxy metrics
	 */
	// ProxyConnectCount is the metric for the total number of proxies connected to the controller
	ProxyConnectCount prometheus.Gauge

	// ProxyReconnectCount is the metric for the total reconnects from known proxies to the controller
	ProxyReconnectCount prometheus.Counter

	// ProxyConfigUpdateTime is the histogram to track time spent for proxy configuration and its occurrences
	ProxyConfigUpdateTime *prometheus.HistogramVec

	// ProxyBroadcastEventCounter is the metric for the total number of ProxyBroadcast events published
	ProxyBroadcastEventCount prometheus.Counter

	// ProxyResponseSendSuccessCount is the metric for the total number of successful responses sent to the proxies
	ProxyResponseSendSuccessCount *prometheus.CounterVec

	// ProxyResponseSendErrorCount is the metric for the total number of errors encountered while sending responses to proxies
	ProxyResponseSendErrorCount *prometheus.CounterVec

	// ProxyXDSRequestCount counts XDS requests made by proxies
	ProxyXDSRequestCount *prometheus.CounterVec

	// ProxyMaxConnectionsRejected counts the number of proxy connections
	// rejected due to the max connections limit being reached
	ProxyMaxConnectionsRejected prometheus.Counter

	// AdmissionWebhookResponseTotal counts the number of webhook responses
	// generated for both validating and mutating webhooks
	AdmissionWebhookResponseTotal *prometheus.CounterVec

	/*
	 * Certificate metrics
	 */
	// CertIssuedCount is the metric counter for the number of certificates issued
	CertIssuedCount prometheus.Counter

	// CertXdsIssuedCounter the histogram to track the time to issue a certificates
	CertIssuedTime *prometheus.HistogramVec

	/*
	 * ErrCode metrics
	 */
	// ErrCodeCounter is the metric counter for the number of errcodes generated by OSM
	ErrCodeCounter *prometheus.CounterVec

	// HTTPResponseTotal is the metric counter for the number of HTTP responses
	// sent by OSM's HTTP handlers
	HTTPResponseTotal *prometheus.CounterVec

	// HTTPResponseDuration is the histogram to track the time to respond to
	// HTTP requests
	HTTPResponseDuration *prometheus.HistogramVec

	// FeatureFlagEnabled represents whether each feature flag is enabled (1) or
	// disabled (0)
	FeatureFlagEnabled *prometheus.GaugeVec

	// VersionInfo contains the static version information of OSM as labels. The gauge is always set to 1.
	VersionInfo *prometheus.GaugeVec

	// EventsQueued represents the number of events seen but not yet processed
	// by the control plane
	EventsQueued prometheus.Gauge

	// ReconciliationTotal counts the number of resource reconciliations invoked
	ReconciliationTotal *prometheus.CounterVec
	// contains filtered or unexported fields
}

MetricsStore is a type that provides functionality related to metrics

func (*MetricsStore) Contains

func (ms *MetricsStore) Contains(metric string) bool

Contains returns whether or not the given string appears in the store's HTTP handler response

func (*MetricsStore) Handler

func (ms *MetricsStore) Handler() http.Handler

Handler return the registry

func (*MetricsStore) Start

func (ms *MetricsStore) Start(cs ...prometheus.Collector)

Start store

func (*MetricsStore) Stop

func (ms *MetricsStore) Stop(cs ...prometheus.Collector)

Stop store

Jump to

Keyboard shortcuts

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