metrics

package
v0.0.0-...-1eb78b9 Latest Latest
Warning

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

Go to latest
Published: May 18, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceSyncerSubsystem  = "syncer"
	PodOperationsKey         = "pod_operations_total"
	PodOperationsDurationKey = "pod_operations_duration_seconds"
	CheckerMissMatchKey      = "checker_missmatch_count"
	CheckerRemedyKey         = "checker_remedy_count"
	CheckerScanDurationKey   = "checker_scan_duaration_seconds"
	DWSOperationCounterKey   = "dws_operations_total"
	DWSOperationDurationKey  = "dws_operations_duration_seconds"
	UWSOperationCounterKey   = "uws_operations_total"
	UWSOperationDurationKey  = "uws_operations_duration_seconds"
	ClusterHealthKey         = "virtual_cluster_health"
)

Variables

View Source
var (
	PodOperations = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      PodOperationsKey,
			Help:      "Cumulative number of pod operations by operation type.",
		},
		[]string{"operation_type", "code"},
	)
	PodOperationsDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      PodOperationsDurationKey,
			Help:      "Duration in seconds of pod operations. Broken down by operation type.",
			Buckets:   prometheus.DefBuckets,
		},
		[]string{"operation_type"},
	)
	CheckerMissMatchStats = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      CheckerMissMatchKey,
			Help:      "Last checker scan results for mismatched resources.",
		},
		[]string{"counter_name"},
	)
	CheckerRemedyStats = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      CheckerRemedyKey,
			Help:      "Cumulative number of checker remediation actions.",
		},
		[]string{"counter_name"},
	)
	CheckerScanDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      CheckerScanDurationKey,
			Help:      "Duration in seconds of each resource checker's scan time.",
			Buckets:   prometheus.DefBuckets,
		},
		[]string{"resource"},
	)
	DWSOperationDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      DWSOperationDurationKey,
			Help:      "Duration in seconds of each resource dws operation time.",
			Buckets:   prometheus.DefBuckets,
		},
		[]string{"resource", "vc_name"})
	DWSOperationCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      DWSOperationCounterKey,
			Help:      "Cumulative number of downward resource operations.",
		},
		[]string{"resource", "vc_name", "code"})
	UWSOperationDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      UWSOperationDurationKey,
			Help:      "Duration in seconds of resource uws operation time.",
			Buckets:   prometheus.DefBuckets,
		},
		[]string{"resource"},
	)
	UWSOperationCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      UWSOperationCounterKey,
			Help:      "Cumulative number of upward resource operations.",
		},
		[]string{"resource", "code"})
	ClusterHealthStats = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: ResourceSyncerSubsystem,
			Name:      ClusterHealthKey,
			Help:      "Last checker scan status for virtual clusters.",
		},
		[]string{"status"},
	)
)

Functions

func RecordCheckerScanDuration

func RecordCheckerScanDuration(resource string, start time.Time)

func RecordDWSOperationDuration

func RecordDWSOperationDuration(resource, cluster string, start time.Time)

func RecordDWSOperationStatus

func RecordDWSOperationStatus(resource, cluster, code string)

func RecordUWSOperationDuration

func RecordUWSOperationDuration(resource string, start time.Time)

func RecordUWSOperationStatus

func RecordUWSOperationStatus(resource, code string)

func Register

func Register()

Register all metrics.

func SinceInMicroseconds

func SinceInMicroseconds(start time.Time) float64

Gets the time since the specified start in microseconds.

func SinceInSeconds

func SinceInSeconds(start time.Time) float64

SinceInSeconds gets the time since the specified start in seconds.

Types

This section is empty.

Jump to

Keyboard shortcuts

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