metrics

package
v0.0.0-...-4263410 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailabilityBatchSendDuration = prometheus.NewHistogram(
	prometheus.HistogramOpts{
		Name:        "availability_batch_send_duration",
		Help:        "availability kafka batch send duration (in ms)",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "api"},
		Buckets:     []float64{5, 10, 25, 50, 100, 250, 500, 2000},
	},
)
View Source
var AvailabilityCheckReqsDuration = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:        "provisioning_source_availability_check_request_duration_ms",
		Help:        "availability check request duration partitioned by type and error",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "statuser"},
		Buckets:     []float64{50, 100, 250, 500, 1000, 2500, 6000},
	},
	[]string{"type", "error"},
)
View Source
var BackgroundJobDuration = prometheus.NewHistogramVec(
	prometheus.HistogramOpts{
		Name:        "provisioning_background_job_duration",
		Help:        "task queue job duration (in seconds) by type",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "worker"},
		Buckets:     []float64{0.5, 1, 2, 3, 4, 5, 7, 10, 30, 60 * 2, 60 * 10, 60 * 30},
	},
	[]string{"type"},
)
View Source
var CacheHits = prometheus.NewCounterVec(prometheus.CounterOpts{
	Name:        "provisioning_cache_hits",
	Help:        "The total number of cache hits per type with result (hit, miss, err)",
	ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName},
}, []string{"type", "result"})
View Source
var DbStatsDuration = prometheus.NewHistogram(
	prometheus.HistogramOpts{
		Name:        "provisioning_db_stats_duration",
		Help:        "database statistics duration (in seconds)",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "stats"},
		Buckets:     []float64{0.2, 0.5, 1, 2, 3, 4, 5, 30},
	},
)
View Source
var JobQueueInFlight = prometheus.NewGaugeVec(prometheus.GaugeOpts{
	Name:        "provisioning_job_queue_inflight",
	Help:        "number of in-flight jobs (total jobs which are currently processing)",
	ConstLabels: prometheus.Labels{"service": "provisioning", "component": "stats"},
}, []string{"worker"})
View Source
var JobQueueSize = prometheus.NewGauge(prometheus.GaugeOpts{
	Name:        "provisioning_job_queue_size",
	Help:        "background job queue size (total pending jobs)",
	ConstLabels: prometheus.Labels{"service": "provisioning", "component": "stats"},
})
View Source
var RbacAclFetchDuration = prometheus.NewHistogram(
	prometheus.HistogramOpts{
		Name:        "provisioning_rbac_acl_request_duration",
		Help:        "duration of ACL request to RBAC service (ms)",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "api"},
		Buckets:     []float64{5, 10, 25, 50, 100, 250, 500},
	},
)
View Source
var ReservationCount = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name:        "provisioning_reservation_count",
		Help:        "reservation count by result (success/failure) by type (aws/gcp/azure)",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "worker"},
	},
	[]string{"type", "result"},
)
View Source
var Reservations24hCount = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name:        "provisioning_reservations_24h_count",
		Help:        "calculated sum of reservations in last 24 hours per result and provider",
		ConstLabels: prometheus.Labels{"service": "provisioning", "component": "stats"},
	},
	[]string{"result", "provider"},
)
View Source
var Reservations28dCount = prometheus.NewGaugeVec(
	prometheus.GaugeOpts{
		Name:        "provisioning_reservations_28d_count",
		Help:        "calculated sum of reservations in last 28 days per result and provider",
		ConstLabels: prometheus.Labels{"service": "provisioning", "component": "stats"},
	},
	[]string{"result", "provider"},
)
View Source
var TotalInvalidAvailabilityCheckReqs = prometheus.NewCounter(
	prometheus.CounterOpts{
		Name:        "provisioning_invalid_source_availability_check_request_total",
		Help:        "invalid availability check requests count partitioned by component",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "statuser"},
	},
)
View Source
var TotalSentAvailabilityCheckReqs = prometheus.NewCounterVec(
	prometheus.CounterOpts{
		Name:        "provisioning_source_availability_check_request_total",
		Help:        "availability check requests count partitioned by type (aws/gcp/azure), source status, component and error",
		ConstLabels: prometheus.Labels{"service": version.PrometheusLabelName, "component": "statuser"},
	},
	[]string{"type", "status", "error"},
)

Functions

func IncCacheHit

func IncCacheHit(model, result string)

func IncReservationCount

func IncReservationCount(rtype, result string)

func IncTotalInvalidAvailabilityCheckReqs

func IncTotalInvalidAvailabilityCheckReqs()

func IncTotalSentAvailabilityCheckReqs

func IncTotalSentAvailabilityCheckReqs(provider string, statusType string, err error)

func ObserveAvailabilityCheckReqsDuration

func ObserveAvailabilityCheckReqsDuration(provider string, observedFunc func() error)

func ObserveAvailabilitySendDuration

func ObserveAvailabilitySendDuration(observedFunc func())

func ObserveBackgroundJobDuration

func ObserveBackgroundJobDuration(jobType string, observedFunc func())

func ObserveDbStatsDuration

func ObserveDbStatsDuration(observedFunc func())

func RegisterApiMetrics

func RegisterApiMetrics()

func RegisterStatsMetrics

func RegisterStatsMetrics()

func RegisterStatuserMetrics

func RegisterStatuserMetrics()

func RegisterWorkerMetrics

func RegisterWorkerMetrics()

func SetJobQueueInFlight

func SetJobQueueInFlight(workerName string, inflight int64)

func SetJobQueueSize

func SetJobQueueSize(size uint64)

func SetReservations24hCount

func SetReservations24hCount(result string, pt models.ProviderType, count int64)

func SetReservations28dCount

func SetReservations28dCount(result string, pt models.ProviderType, count int64)

Types

This section is empty.

Jump to

Keyboard shortcuts

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