Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterMetrics()
- type LabelPropagationMetrics
- type LabelPropagationStats
- type SyncerMetrics
- func (sm *SyncerMetrics) CollectDualStackMigrationMetrics(key negtypes.NegSyncerKey, ...)
- func (sm *SyncerMetrics) DeleteSyncer(key negtypes.NegSyncerKey)
- func (sm *SyncerMetrics) Run(stopCh <-chan struct{})
- func (sm *SyncerMetrics) SetLabelPropagationStats(key negtypes.NegSyncerKey, ...)
- func (sm *SyncerMetrics) UpdateSyncerEPMetrics(key negtypes.NegSyncerKey, ...)
- func (sm *SyncerMetrics) UpdateSyncerNegCount(key negtypes.NegSyncerKey, negsByLocation map[string]int)
- func (sm *SyncerMetrics) UpdateSyncerStatusInMetrics(key negtypes.NegSyncerKey, err error, inErrorState bool)
- type SyncerMetricsCollector
Constants ¶
const ( // Label Values for Syncer Sync Result Metrics EPCountsDiffer = "EndpointCountsDiffer" EPNodeMissing = "EndpointNodeMissing" EPNodeNotFound = "EndpointNodeNotFound" EPPodMissing = "EndpointPodMissing" EPPodNotFound = "EndpointPodNotFound" EPPodTypeAssertionFailed = "EndpointPodTypeAssertionFailed" EPZoneMissing = "EndpointZoneMissing" EPSEndpointCountZero = "EndpointSliceEndpointCountZero" EPCalculationCountZero = "EndpointCalculationCountZero" InvalidAPIResponse = "InvalidAPIResponse" InvalidEPAttach = "InvalidEndpointAttach" InvalidEPDetach = "InvalidEndpointDetach" NegNotFound = "NetworkEndpointGroupNotFound" CurrentNegEPNotFound = "CurrentNEGEndpointNotFound" EPSNotFound = "EndpointSliceNotFound" OtherError = "OtherError" Success = "Success" )
Variables ¶
var ( // SyncerCountBySyncResult tracks the count of syncer in different states SyncerCountBySyncResult = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Subsystem: negControllerSubsystem, Name: "syncer_count", Help: "Current count of syncers in each state", }, []string{"last_sync_result", "in_error_state"}, ) NumberOfEndpoints = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Subsystem: negControllerSubsystem, Name: "number_of_endpoints", Help: "The total number of endpoints", }, []string{"feature"}, ) DualStackMigrationFinishedDurations = prometheus.NewHistogram( prometheus.HistogramOpts{ Subsystem: negControllerSubsystem, Name: "dual_stack_migration_finished_durations_seconds", Help: "Time taken to migrate all endpoints within all NEGs for a service port", Buckets: prometheus.ExponentialBuckets(1, 1.85, 18), }, ) // A zero value for this metric means that there are no ongoing migrations. DualStackMigrationLongestUnfinishedDuration = prometheus.NewGauge( prometheus.GaugeOpts{ Subsystem: negControllerSubsystem, Name: "dual_stack_migration_longest_unfinished_duration_seconds", Help: "Longest time elapsed since a migration was started which hasn't yet completed", }, ) SyncerCountByEndpointType = prometheus.NewGaugeVec( prometheus.GaugeOpts{ Subsystem: negControllerSubsystem, Name: "syncer_count_by_endpoint_type", Help: "Number of Syncers managing NEGs containing endpoint of a particular kind", }, []string{"endpoint_type"}, ) DualStackMigrationServiceCount = prometheus.NewGauge( prometheus.GaugeOpts{ Subsystem: negControllerSubsystem, Name: "dual_stack_migration_service_count", Help: "Number of Services which have migration endpoints", }, ) )
Functions ¶
func RegisterMetrics ¶
func RegisterMetrics()
RegisterSyncerMetrics registers syncer related metrics
Types ¶
type LabelPropagationMetrics ¶
LabelPropagationMetrics contains aggregated label propagation related metrics.
type LabelPropagationStats ¶
LabelPropagationStat contains stats related to label propagation.
type SyncerMetrics ¶
type SyncerMetrics struct {
// contains filtered or unexported fields
}
func FakeSyncerMetrics ¶
func FakeSyncerMetrics() *SyncerMetrics
FakeSyncerMetrics creates new NegMetricsCollector with fixed 5 second metricsInterval, to be used in tests
func NewNegMetricsCollector ¶
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) CollectDualStackMigrationMetrics ¶ added in v1.24.0
func (sm *SyncerMetrics) CollectDualStackMigrationMetrics(key negtypes.NegSyncerKey, committedEndpoints map[string]negtypes.NetworkEndpointSet, migrationCount int)
CollectDualStackMigrationMetrics will be used by dualstack.Migrator to export metrics.
func (*SyncerMetrics) DeleteSyncer ¶
func (sm *SyncerMetrics) DeleteSyncer(key negtypes.NegSyncerKey)
DeleteSyncer will reset any metrics for the syncer corresponding to `key`. It should be invoked when a Syncer has been stopped.
func (*SyncerMetrics) Run ¶
func (sm *SyncerMetrics) Run(stopCh <-chan struct{})
func (*SyncerMetrics) SetLabelPropagationStats ¶
func (sm *SyncerMetrics) SetLabelPropagationStats(key negtypes.NegSyncerKey, labelstatLabelPropagationStats LabelPropagationStats)
func (*SyncerMetrics) UpdateSyncerEPMetrics ¶ added in v1.24.0
func (sm *SyncerMetrics) UpdateSyncerEPMetrics(key negtypes.NegSyncerKey, endpointCount, endpointSliceCount negtypes.StateCountMap)
func (*SyncerMetrics) UpdateSyncerNegCount ¶
func (sm *SyncerMetrics) UpdateSyncerNegCount(key negtypes.NegSyncerKey, negsByLocation map[string]int)
func (*SyncerMetrics) UpdateSyncerStatusInMetrics ¶ added in v1.24.0
func (sm *SyncerMetrics) UpdateSyncerStatusInMetrics(key negtypes.NegSyncerKey, err error, inErrorState bool)
UpdateSyncerStatusInMetrics update the status of syncer based on the error
type SyncerMetricsCollector ¶
type SyncerMetricsCollector interface { // UpdateSyncerStatusInMetrics update the status of corresponding syncer based on the sync error UpdateSyncerStatusInMetrics(key negtypes.NegSyncerKey, err error, inErrorState bool) // UpdateSyncerEPMetrics update the endpoint and endpointSlice count for the given syncer UpdateSyncerEPMetrics(key negtypes.NegSyncerKey, endpointCount, endpointSliceCount negtypes.StateCountMap) SetLabelPropagationStats(key negtypes.NegSyncerKey, labelstatLabelPropagationStats LabelPropagationStats) // Updates the number of negs per syncer per zone UpdateSyncerNegCount(key negtypes.NegSyncerKey, negByLocation map[string]int) }