metrics

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Package metrics is a generated GoMock package.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Common gauges across os distributions
	DropPacketsGauge    GaugeVec
	DropBytesGauge      GaugeVec
	ForwardPacketsGauge GaugeVec
	ForwardBytesGauge   GaugeVec

	WindowsGauge GaugeVec

	// Common gauges across os distributions
	NodeConnectivityStatusGauge  GaugeVec
	NodeConnectivityLatencyGauge GaugeVec

	// TCP Stats
	TCPStateGauge            GaugeVec
	TCPConnectionRemoteGauge GaugeVec
	TCPConnectionStatsGauge  GaugeVec
	TCPFlagGauge             GaugeVec

	// IP States
	IPConnectionStatsGauge GaugeVec

	// UDP Stats
	UDPConnectionStatsGauge GaugeVec

	// Interface Stats
	InterfaceStatsGauge GaugeVec

	// Control Plane Metrics
	PluginManagerFailedToReconcileCounter CounterVec
	LostEventsCounter                     CounterVec

	// DNS Metrics.
	DNSRequestCounter  CounterVec
	DNSResponseCounter CounterVec

	InfinibandStatsGauge        GaugeVec
	InfinibandStatusParamsGauge GaugeVec
)

Metric Counters

Functions

func GetCounterValue

func GetCounterValue(m prometheus.Counter) float64

GetCounterValue returns the current value stored for the counter

func GetDropTypeFlowDropReason

func GetDropTypeFlowDropReason(dr flow.DropReason) string

func InitializeMetrics

func InitializeMetrics()

Initiates and creates the common metrics

func ToPrometheusType

func ToPrometheusType(metric interface{}) prometheus.Collector

Types

type CounterVec added in v0.0.16

type CounterVec interface {
	WithLabelValues(lvs ...string) prometheus.Counter
	GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)
}

type DropReasonType

type DropReasonType uint32
const (
	IPTABLE_RULE_DROP DropReasonType = iota
	IPTABLE_NAT_DROP
	TCP_CONNECT_BASIC
	TCP_ACCEPT_BASIC
	TCP_CLOSE_BASIC
	CONNTRACK_ADD_DROP
	UNKNOWN_DROP
)

Alert: this ordering should match the drop_reason_t enum ordering in dropreason.h of DropReason plugin

func GetDropType

func GetDropType(value uint32) DropReasonType

func (DropReasonType) String

func (d DropReasonType) String() string

type GaugeVec added in v0.0.16

type GaugeVec interface {
	WithLabelValues(lvs ...string) prometheus.Gauge
	GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error)
}

type Histogram added in v0.0.16

type Histogram interface {
	Observe(float64)
	// Keep the Write method for testing purposes.
	Write(*dto.Metric) error
}

type MockCounterVec added in v0.0.16

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

MockCounterVec is a mock of CounterVec interface.

func NewMockCounterVec added in v0.0.16

func NewMockCounterVec(ctrl *gomock.Controller) *MockCounterVec

NewMockCounterVec creates a new mock instance.

func (*MockCounterVec) EXPECT added in v0.0.16

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockCounterVec) GetMetricWithLabelValues added in v0.0.16

func (m *MockCounterVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Counter, error)

GetMetricWithLabelValues mocks base method.

func (*MockCounterVec) WithLabelValues added in v0.0.16

func (m *MockCounterVec) WithLabelValues(lvs ...string) prometheus.Counter

WithLabelValues mocks base method.

type MockCounterVecMockRecorder added in v0.0.16

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

MockCounterVecMockRecorder is the mock recorder for MockCounterVec.

func (*MockCounterVecMockRecorder) GetMetricWithLabelValues added in v0.0.16

func (mr *MockCounterVecMockRecorder) GetMetricWithLabelValues(lvs ...any) *gomock.Call

GetMetricWithLabelValues indicates an expected call of GetMetricWithLabelValues.

func (*MockCounterVecMockRecorder) WithLabelValues added in v0.0.16

func (mr *MockCounterVecMockRecorder) WithLabelValues(lvs ...any) *gomock.Call

WithLabelValues indicates an expected call of WithLabelValues.

type MockGaugeVec added in v0.0.16

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

MockGaugeVec is a mock of GaugeVec interface.

func NewMockGaugeVec added in v0.0.16

func NewMockGaugeVec(ctrl *gomock.Controller) *MockGaugeVec

NewMockGaugeVec creates a new mock instance.

func (*MockGaugeVec) EXPECT added in v0.0.16

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockGaugeVec) GetMetricWithLabelValues added in v0.0.16

func (m *MockGaugeVec) GetMetricWithLabelValues(lvs ...string) (prometheus.Gauge, error)

GetMetricWithLabelValues mocks base method.

func (*MockGaugeVec) WithLabelValues added in v0.0.16

func (m *MockGaugeVec) WithLabelValues(lvs ...string) prometheus.Gauge

WithLabelValues mocks base method.

type MockGaugeVecMockRecorder added in v0.0.16

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

MockGaugeVecMockRecorder is the mock recorder for MockGaugeVec.

func (*MockGaugeVecMockRecorder) GetMetricWithLabelValues added in v0.0.16

func (mr *MockGaugeVecMockRecorder) GetMetricWithLabelValues(lvs ...any) *gomock.Call

GetMetricWithLabelValues indicates an expected call of GetMetricWithLabelValues.

func (*MockGaugeVecMockRecorder) WithLabelValues added in v0.0.16

func (mr *MockGaugeVecMockRecorder) WithLabelValues(lvs ...any) *gomock.Call

WithLabelValues indicates an expected call of WithLabelValues.

type MockHistogram added in v0.0.16

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

MockHistogram is a mock of Histogram interface.

func NewMockHistogram added in v0.0.16

func NewMockHistogram(ctrl *gomock.Controller) *MockHistogram

NewMockHistogram creates a new mock instance.

func (*MockHistogram) EXPECT added in v0.0.16

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockHistogram) Observe added in v0.0.16

func (m *MockHistogram) Observe(arg0 float64)

Observe mocks base method.

func (*MockHistogram) Write added in v0.0.16

Write mocks base method.

type MockHistogramMockRecorder added in v0.0.16

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

MockHistogramMockRecorder is the mock recorder for MockHistogram.

func (*MockHistogramMockRecorder) Observe added in v0.0.16

func (mr *MockHistogramMockRecorder) Observe(arg0 any) *gomock.Call

Observe indicates an expected call of Observe.

func (*MockHistogramMockRecorder) Write added in v0.0.16

func (mr *MockHistogramMockRecorder) Write(arg0 any) *gomock.Call

Write indicates an expected call of Write.

Jump to

Keyboard shortcuts

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