Documentation
¶
Overview ¶
Package metrics defines the Prometheus metrics exported by Kargo's controller. Collectors are registered with the controller-runtime registry, which backs the metrics endpoint served by the controller's manager.
Package metrics defines the Prometheus metrics exported by Kargo's controller. Collectors are registered with the controller-runtime registry, which backs the metrics endpoint served by the controller's manager.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterStageMetrics ¶
RegisterStageMetrics registers the Stage metrics with the controller-runtime registry. They are all sampled from the cache at scrape time rather than recorded to, so there is nothing for a caller to hold on to and nothing is returned. It panics if any of the collectors is already registered. Calling this function more than once registers nothing further.
Types ¶
type PromotionMetrics ¶
type PromotionMetrics struct {
// Completed counts Promotions that have reached a terminal phase. It is
// additionally labeled by that phase, so a single series describes both how
// many Promotions finished and how they finished.
Completed *prometheus.CounterVec
// Duration observes, in seconds, how long each Promotion spent running --
// measured from the moment it transitioned to Running until it reached a
// terminal phase. It is additionally labeled by outcome. Promotions that
// end without ever having started are not observed.
Duration *prometheus.HistogramVec
}
PromotionMetrics describes Promotion activity observed by the controller. All of its collectors are labeled by the Project the Promotion belongs to.
func NewPromotionMetrics ¶
func NewPromotionMetrics( c client.Client, ) *PromotionMetrics
NewPromotionMetrics returns PromotionMetrics whose collectors have been registered with the controller-runtime registry. It panics if any of the collectors is already registered. Calling this function multiple times will return the same PromotionMetrics instance.