metrics

package
v1.23.14 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 3 Imported by: 2

Documentation

Index

Constants

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

	//Classification of GCE Requests
	GetRequest            = "Get"
	CreateRequest         = "Create"
	DeleteRequest         = "Delete"
	ListRequest           = "List"
	AggregatedListRequest = "AggregatedList"
	AttachNERequest       = "AttachNE"
	DetachNERequest       = "Detach"
	ListNERequest         = "ListNE"
	ListNEHealthRequest   = "ListNEHealth"
)

Variables

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

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		[]string{
			"operation",
			"neg_type",
			"api_version",
			"result",
		},
	)

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

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		[]string{
			"operation",
			"neg_type",
			"result",
		},
	)

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

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		[]string{
			"neg_type",
			"endpoint_calculator_mode",
			"result",
		},
	)

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

			Buckets: prometheus.ExponentialBuckets(1, 2, 13),
		},
		[]string{
			"process",
			"result",
		},
	)

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

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

	LastSyncTimestamp = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Subsystem: negControllerSubsystem,
			Name:      "sync_timestamp",
			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:      "syncer_staleness",
			Help:      "The duration of a syncer since it last syncs",

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

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

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

	LabelNumber = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "label_number_per_endpoint",
			Help:      "The number of labels per endpoint",

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

	AnnotationSize = prometheus.NewHistogram(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "annotation_size_per_endpoint",
			Help:      "The size in byte of endpoint annotations per endpoint",

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

	LabelPropagationError = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: negControllerSubsystem,
			Name:      "label_propagation_error_count",
			Help:      "the number of errors occurred for label propagation",
		},
		[]string{"error_type"},
	)

	// GCERequestCount trackes the number requests the neg controller sends to the NEG API
	GCERequestCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: negControllerSubsystem,
			Name:      "gce_request_count",
			Help:      "Number of requests generated by the Neg Controller",
		},
		[]string{"request", "result"},
	)

	// GCERequestCount trackes the number requests the neg controller sends to the NEG API
	GCERequestLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: negControllerSubsystem,
			Name:      "gce_request_latency",
			Help:      "GCE Request Latency for requests generated by the Neg Controller",

			Buckets: append([]float64{0.001, 0.01, 0.1}, prometheus.ExponentialBuckets(1, 2, 20)...),
		},
		[]string{"request", "result"},
	)
)

Functions

func PublishAnnotationMetrics added in v1.23.0

func PublishAnnotationMetrics(annotationSize int, labelNumber int)

PublishAnnotationMetrics publishes collected metrics for endpoint annotations.

func PublishGCERequestCountMetrics added in v1.23.10

func PublishGCERequestCountMetrics(start time.Time, requestType string, err error)

PublishGCERequestCountMetrics publishes collected metrics for GCE Request Counts

func PublishLabelPropagationError added in v1.23.0

func PublishLabelPropagationError(errType string)

PublishLabelPropagationError publishes error occured during label propagation.

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()

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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