Documentation
¶
Index ¶
- Variables
- func StartMetricsCollector(metricCollectorPort string, shouldStart bool)
- type IMetricRecorder
- type IMetricRecorderOptions
- type MetricRecorder
- func (mr *MetricRecorder) RecordCounterMetric(metric *prometheus.CounterVec, labels map[string]string)
- func (mr *MetricRecorder) RecordGaugeMetric(metric *prometheus.GaugeVec, labels map[string]string, value float64)
- func (mr *MetricRecorder) WithNamespace(ns string) *MetricRecorder
- func (mr *MetricRecorder) WithProject(project string) *MetricRecorder
- func (mr *MetricRecorder) WithSlice(slice string) *MetricRecorder
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 ¶
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
Click to show internal directories.
Click to hide internal directories.