metrics

package
v1.22.3 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const (
	GCProcess   = "GC"
	SyncProcess = "Sync"
)

Variables

View Source
var (
	NegOperationLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      negOpLatencyKey,
			Help:      "Latency of a NEG Operation",

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		negOpLatencyMetricsLabels,
	)

	NegOperationEndpoints = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      negOpEndpointsKey,
			Help:      "Number of Endpoints during an NEG Operation",

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		negOpEndpointsMetricsLabels,
	)

	SyncerSyncLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      syncerLatencyKey,
			Help:      "Sync latency for NEG Syncer",

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		syncerMetricsLabels,
	)

	ManagerProcessLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      managerProcessLatencyKey,
			Help:      "Process latency for NEG Manager",

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		negProcessMetricsLabels,
	)

	InitializationLatency = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      initLatencyKey,
			Help:      "Initialization latency of a NEG",

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
	)

	LastSyncTimestamp = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Subsystem: negControllerSubsystem,
			Name:      lastSyncTimestampKey,
			Help:      "The timestamp of the last execution of NEG controller sync loop.",
		},
	)

	// SyncerStaleness tracks for every syncer, how long since the syncer last syncs
	SyncerStaleness = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      syncerStalenessKey,
			Help:      "The duration of a syncer since it last syncs",
		},
	)

	// EPSStaleness tracks for every endpoint slice, how long since it was last processed
	EPSStaleness = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      epsStalenessKey,
			Help:      "The duration for an endpoint slice since it was last processed by syncer",

			Buckets: prometheus.ExponentialBuckets(1, 2, 14),
		},
	)
)

Functions

func PublishNegEPSStalenessMetrics added in v1.22.0

func PublishNegEPSStalenessMetrics(epsStaleness time.Duration)

func PublishNegInitializationMetrics added in v1.10.2

func PublishNegInitializationMetrics(latency time.Duration)

PublishNegInitializationMetrics publishes collected metrics for time from request to initialization of NEG

func PublishNegManagerProcessMetrics added in v1.10.2

func PublishNegManagerProcessMetrics(process string, err error, start time.Time)

PublishNegManagerProcessMetrics publishes collected metrics for the neg manager loops

func PublishNegOperationMetrics added in v1.10.2

func PublishNegOperationMetrics(operation, negType, apiVersion string, err error, numEndpoints int, start time.Time)

PublishNegOperationMetrics publishes collected metrics for neg operations

func PublishNegSyncMetrics added in v1.10.2

func PublishNegSyncMetrics(negType, endpointCalculator string, err error, start time.Time)

PublishNegSyncMetrics publishes collected metrics for the sync of NEG

func PublishNegSyncerStalenessMetrics added in v1.22.0

func PublishNegSyncerStalenessMetrics(syncerStaleness time.Duration)

func RegisterMetrics

func RegisterMetrics()

func RegisterSyncerMetrics added in v1.22.0

func RegisterSyncerMetrics()

RegisterSyncerMetrics registers syncer related metrics

Types

type SyncerMetrics added in v1.22.0

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

func FakeSyncerMetrics added in v1.22.0

func FakeSyncerMetrics() *SyncerMetrics

FakeSyncerMetrics creates new NegMetricsCollector with fixed 5 second metricsInterval, to be used in tests

func NewNegMetricsCollector added in v1.22.0

func NewNegMetricsCollector(exportInterval time.Duration, logger klog.Logger) *SyncerMetrics

NewNEGMetricsCollector initializes SyncerMetrics and starts a go routine to compute and export metrics periodically.

func (*SyncerMetrics) Run added in v1.22.0

func (sm *SyncerMetrics) Run(stopCh <-chan struct{})

func (*SyncerMetrics) UpdateSyncer added in v1.22.0

func (sm *SyncerMetrics) UpdateSyncer(key negtypes.NegSyncerKey, syncResult *negtypes.NegSyncResult)

UpdateSyncer update the status of corresponding syncer based on the syncResult.

type SyncerMetricsCollector added in v1.22.0

type SyncerMetricsCollector interface {
	UpdateSyncer(key negtypes.NegSyncerKey, result *negtypes.NegSyncResult)
}

Jump to

Keyboard shortcuts

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