Documentation ¶
Index ¶
- Constants
- Variables
- func PublishAnnotationMetrics(annotationSize int, labelNumber int)
- func PublishLabelPropagationError(errType string)
- func PublishNegEPSStalenessMetrics(epsStaleness time.Duration)
- func PublishNegInitializationMetrics(latency time.Duration)
- func PublishNegManagerProcessMetrics(process string, err error, start time.Time)
- func PublishNegOperationMetrics(operation, negType, apiVersion string, err error, numEndpoints int, ...)
- func PublishNegSyncMetrics(negType, endpointCalculator string, err error, start time.Time)
- func PublishNegSyncerStalenessMetrics(syncerStaleness time.Duration)
- func RegisterMetrics()
- func RegisterSyncerMetrics()
- type LabelPropagationMetrics
- type LabelPropagationStats
- type SyncerMetrics
- func (sm *SyncerMetrics) Run(stopCh <-chan struct{})
- func (sm *SyncerMetrics) SetLabelPropagationStats(key negtypes.NegSyncerKey, ...)
- func (sm *SyncerMetrics) SetSyncerEPMetrics(key negtypes.NegSyncerKey, endpointStat *negtypes.SyncerEPStat)
- func (sm *SyncerMetrics) UpdateSyncer(key negtypes.NegSyncerKey, syncResult *negtypes.NegSyncResult)
- type SyncerMetricsCollector
Constants ¶
const ( GCProcess = "GC" SyncProcess = "Sync" )
Variables ¶
var ( NumberOfEndpoints = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Subsystem: negControllerSubsystem, Name: numberOfEndpoints, Help: "The total number of endpoints", }, endpointAnnotationLabels, ) LabelNumber = prometheus.NewHistogram( prometheus.HistogramOpts{ Subsystem: negControllerSubsystem, Name: labelNumber, Help: "The number of labels per endpoint", Buckets: prometheus.ExponentialBuckets(1, 2, 13), }, ) AnnotationSize = prometheus.NewHistogram( prometheus.HistogramOpts{ Subsystem: negControllerSubsystem, Name: annotationSize, Help: "The size in byte of endpoint annotations per endpoint", Buckets: prometheus.ExponentialBuckets(1, 2, 13), }, ) LabelPropagationError = prometheus.NewCounterVec( prometheus.CounterOpts{ Subsystem: negControllerSubsystem, Name: labelErrorNumber, Help: "the number of errors occurred for label propagation", }, labelPropagationErrorLabels, ) )
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 PublishAnnotationMetrics ¶ added in v1.23.0
PublishAnnotationMetrics publishes collected metrics for endpoint annotations.
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 PublishNegInitializationMetrics ¶ added in v1.10.2
PublishNegInitializationMetrics publishes collected metrics for time from request to initialization of NEG
func PublishNegManagerProcessMetrics ¶ added in v1.10.2
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
PublishNegSyncMetrics publishes collected metrics for the sync of NEG
func PublishNegSyncerStalenessMetrics ¶ added in v1.22.0
func RegisterMetrics ¶
func RegisterMetrics()
func RegisterSyncerMetrics ¶ added in v1.22.0
func RegisterSyncerMetrics()
RegisterSyncerMetrics registers syncer related metrics
Types ¶
type LabelPropagationMetrics ¶ added in v1.23.0
LabelPropagationMetrics contains aggregated label propagation related metrics.
type LabelPropagationStats ¶ added in v1.23.0
LabelPropagationStat contains stats related to label propagation.
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) SetLabelPropagationStats ¶ added in v1.23.0
func (sm *SyncerMetrics) SetLabelPropagationStats(key negtypes.NegSyncerKey, labelstatLabelPropagationStats LabelPropagationStats)
func (*SyncerMetrics) SetSyncerEPMetrics ¶ added in v1.23.0
func (sm *SyncerMetrics) SetSyncerEPMetrics(key negtypes.NegSyncerKey, endpointStat *negtypes.SyncerEPStat)
SetSyncerEPMetrics update the endpoint count based on the endpointStat
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) SetSyncerEPMetrics(key negtypes.NegSyncerKey, epState *negtypes.SyncerEPStat) SetLabelPropagationStats(key negtypes.NegSyncerKey, labelstatLabelPropagationStats LabelPropagationStats) }