metrics

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KubeSliceEventsCounter *prometheus.CounterVec
)

create latency metrics which has to be populated when we receive latency from tunnel

View Source
var (
	PROMETHEUS_SERVICE_ENDPOINT = "http://kubeslice-controller-prometheus-service:9090"
)

Functions

func StartMetricsCollector

func StartMetricsCollector(metricCollectorPort string, shouldStart bool)

StartMetricsCollector registers metrics to prometheus

Types

type IMetricRecorder

type IMetricRecorder interface {
	// RecordGaugeMetric is used to record a new gauge metric
	RecordGaugeMetric(metric *prometheus.GaugeVec, labels map[string]string, value float64)
	// RecordCounterMetric is used to record a new counter metric
	RecordCounterMetric(metric *prometheus.CounterVec, labels map[string]string)
	// WithSlice returns a new recorder with slice name added
	WithSlice(string) *MetricRecorder
	// WithNamespace returns a new recorder with namespace name added
	WithNamespace(string) *MetricRecorder
	// WithProject returns a new recorder with project name added
	WithProject(string) *MetricRecorder
}

IMetricRecorder is used to record metrics from a component

type IMetricRecorderOptions

type IMetricRecorderOptions struct {
	// Project is the name of the project
	Project string
	// Slice is the name of the slice
	Slice string
	// Namespace is the namespace this metric recorder corresponds to
	Namespace string
}

IMetricRecorderOptions provides a container with config parameters for the Prometheus Exporter

type MetricRecorder

type MetricRecorder struct {
	Options IMetricRecorderOptions
}

func (*MetricRecorder) RecordCounterMetric

func (mr *MetricRecorder) RecordCounterMetric(metric *prometheus.CounterVec, labels map[string]string)

func (*MetricRecorder) RecordGaugeMetric

func (mr *MetricRecorder) RecordGaugeMetric(metric *prometheus.GaugeVec, labels map[string]string, value float64)

func (*MetricRecorder) WithNamespace

func (mr *MetricRecorder) WithNamespace(ns string) *MetricRecorder

func (*MetricRecorder) WithProject

func (mr *MetricRecorder) WithProject(project string) *MetricRecorder

func (*MetricRecorder) WithSlice

func (mr *MetricRecorder) WithSlice(slice string) *MetricRecorder

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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