metrics

package
v0.0.0-...-a438c6f Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// CLITime is the Terraform CLI execution times histogram.
	CLITime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysTF,
		Name:      "cli_duration",
		Help:      "Measures in seconds how long it takes a Terraform CLI invocation to complete",
		Buckets:   []float64{1.0, 3, 5, 10, 15, 30, 60, 120, 300},
	}, []string{"subcommand", "mode"})

	// ExternalAPITime is the SDK processing times histogram.
	ExternalAPITime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysResource,
		Name:      "ext_api_duration",
		Help:      "Measures in seconds how long it takes a Cloud SDK call to complete",
		Buckets:   []float64{1, 5, 10, 15, 30, 60, 120, 300, 600, 1800, 3600},
	}, []string{"operation"})

	// DeletionTime is the histogram metric for collecting statistics on the
	// intervals between the deletion timestamp and the moment when
	// the resource is observed to be missing (actually deleted).
	DeletionTime = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysResource,
		Name:      "deletion_seconds",
		Help:      "Measures in seconds how long it takes for a resource to be deleted",
		Buckets:   []float64{1, 5, 10, 15, 30, 60, 120, 300, 600, 1800, 3600},
	}, []string{"group", "version", "kind"})

	// ReconcileDelay is the histogram metric for collecting statistics on the
	// delays between when the expected reconciles of an up-to-date resource
	// should happen and when the resource is actually reconciled. Only
	// delays from the expected reconcile times are considered.
	ReconcileDelay = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysResource,
		Name:      "reconcile_delay_seconds",
		Help:      "Measures in seconds how long the reconciles for a resource have been delayed from the configured poll periods",
		Buckets:   []float64{1, 5, 10, 15, 30, 60, 120, 300, 600, 1800, 3600},
	}, []string{"group", "version", "kind"})

	// CLIExecutions are the active number of terraform CLI invocations.
	CLIExecutions = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysTF,
		Name:      "active_cli_invocations",
		Help:      "The number of active (running) Terraform CLI invocations",
	}, []string{"subcommand", "mode"})

	// TFProcesses are the active number of
	// terraform CLI & Terraform provider processes running.
	TFProcesses = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysTF,
		Name:      "running_processes",
		Help:      "The number of running Terraform CLI and Terraform provider processes",
	}, []string{"type"})

	// TTRMeasurements are the time-to-readiness measurements for
	// the managed resources.
	TTRMeasurements = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace: promNSUpjet,
		Subsystem: promSysResource,
		Name:      "ttr",
		Help:      "Measures in seconds the time-to-readiness (TTR) for managed resources",
		Buckets:   []float64{1, 5, 10, 15, 30, 60, 120, 300, 600, 1800, 3600},
	}, []string{"group", "version", "kind"})
)

Functions

This section is empty.

Types

type MetricRecorder

type MetricRecorder struct {
	// contains filtered or unexported fields
}

func NewMetricRecorder

func NewMetricRecorder(gvk schema.GroupVersionKind, c cluster.Cluster, pollInterval time.Duration) *MetricRecorder

func (*MetricRecorder) ObserveReconcileDelay

func (r *MetricRecorder) ObserveReconcileDelay(gvk schema.GroupVersionKind, name string)

func (*MetricRecorder) SetReconcileTime

func (r *MetricRecorder) SetReconcileTime(name string)

func (*MetricRecorder) Start

func (r *MetricRecorder) Start(ctx context.Context) error

type Observations

type Observations struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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