metrics

package
v1.24.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var (
	PSCProcessLatency = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Subsystem: pscControllerSubsystem,
			Name:      pscProcessLatency,
			Help:      "Latency of a PSC Process",

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

	LastProcessTimestamp = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Subsystem: pscControllerSubsystem,
			Name:      lastProcessTimestamp,
			Help:      "The timestamp of the last execution of a PSC process loop.",
		},
		pscProcessTSMetricsLabels,
	)
)

Functions

func PublishLastProcessTimestampMetrics

func PublishLastProcessTimestampMetrics(process string)

PublishLastProcessTimestampMetrics publishes the last timestamp of the provided process

func PublishPSCProcessMetrics

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

PublishLastProcessTimestampMetrics calculates and publishes the process latency

func RegisterMetrics

func RegisterMetrics()

Types

type PSCMetricsCollector

type PSCMetricsCollector interface {
	SetServiceAttachment(saKey string, state PSCState)
	DeleteServiceAttachment(saKey string)
	SetService(serviceKey string)
	DeleteService(serviceKey string)
}

PSCMetricsCollector is used to publish usage metrics

type PSCState

type PSCState struct {
	// InSuccess specifies if the ServiceAttachment was successfully created
	InSuccess bool
}

PSCState tracks service attachment and psc feature usage

Jump to

Keyboard shortcuts

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