metrics

package
v1.6.0-community Latest Latest
Warning

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

Go to latest
Published: May 28, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeCounter   metricType = "counter"
	TypeGauge     metricType = "gauge"
	TypeHistogram metricType = "histogram"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BufferSizeGauge

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

BufferSizeGauge provides syntactic sugar hidding prom's gauge tailored for buffer size

func (*BufferSizeGauge) WithBufferName

func (g *BufferSizeGauge) WithBufferName(bufferName string) prometheus.Gauge

type ErrorCounter

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

func (*ErrorCounter) WithErrorName

func (c *ErrorCounter) WithErrorName(component, errName string) prometheus.Counter

type EvictionCounter

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

EvictionCounter provides syntactic sugar hidding prom's counter for eviction purpose

func (*EvictionCounter) WithSource

func (c *EvictionCounter) WithSource(source string) prometheus.Counter

func (*EvictionCounter) WithSourceAndReason

func (c *EvictionCounter) WithSourceAndReason(source, reason string) prometheus.Counter

type MetricDefinition

type MetricDefinition struct {
	Name   string
	Help   string
	Type   metricType
	Labels []string
}

type Metrics

type Metrics struct {
	Settings *Settings

	// Shared metrics:
	EvictionCounter       *EvictionCounter
	EvictedFlowsCounter   *EvictionCounter
	EvictedPacketsCounter *EvictionCounter
	DroppedFlowsCounter   *EvictionCounter
	FilteredFlowsCounter  *EvictionCounter
	BufferSizeGauge       *BufferSizeGauge
	Errors                *ErrorCounter
}

func NewMetrics

func NewMetrics(settings *Settings) *Metrics

func (*Metrics) CreateBatchCounter

func (m *Metrics) CreateBatchCounter(exporter string) prometheus.Counter

func (*Metrics) CreateSamplingRate

func (m *Metrics) CreateSamplingRate() prometheus.Gauge

func (*Metrics) CreateTimeSpendInLookupAndDelete

func (m *Metrics) CreateTimeSpendInLookupAndDelete() prometheus.Histogram

func (*Metrics) NewCounter

func (m *Metrics) NewCounter(def *MetricDefinition, labels ...string) prometheus.Counter

func (*Metrics) NewCounterVec

func (m *Metrics) NewCounterVec(def *MetricDefinition) *prometheus.CounterVec

func (*Metrics) NewGauge

func (m *Metrics) NewGauge(def *MetricDefinition, labels ...string) prometheus.Gauge

func (*Metrics) NewGaugeVec

func (m *Metrics) NewGaugeVec(def *MetricDefinition) *prometheus.GaugeVec

func (*Metrics) NewHistogram

func (m *Metrics) NewHistogram(def *MetricDefinition, buckets []float64, labels ...string) prometheus.Histogram

type PromConnectionInfo

type PromConnectionInfo struct {
	Address string
	Port    int
	TLS     *PromTLS
}

type PromTLS

type PromTLS struct {
	CertPath string
	KeyPath  string
}

type Settings

type Settings struct {
	PromConnectionInfo
	Prefix string
}

Jump to

Keyboard shortcuts

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