metrics

package
v0.0.0-...-215afb5 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Namespace is the etcd controller's metric namespace
	Namespace = ""
	// EtcdControllerSubsystem - subsystem name used for this controller.
	EtcdControllerSubsystem = "etcd_controller"
)

Variables

View Source
var (
	// EtcdObserveLatency observe the latency from etcd object created to the etcd controller watched
	EtcdObserveLatency = metrics.NewSummary(
		&metrics.SummaryOpts{
			Namespace:      Namespace,
			Subsystem:      EtcdControllerSubsystem,
			Name:           "etcd_observe_latency",
			Help:           "Latency from etcd object created to the etcd controller watched",
			StabilityLevel: metrics.ALPHA,
		})

	// EtcdStartLatency observe the latency from etcd object created to etcd Cluster controller starting
	EtcdStartLatency = metrics.NewSummary(
		&metrics.SummaryOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_start_latency",
			Help:      "Latency from etcd object created to etcd Cluster controller starting",
		})

	// EtcdRunningLatency observe the latency from etcd object created to etcd cluster running
	EtcdRunningLatency = metrics.NewSummary(
		&metrics.SummaryOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_running_latency",
			Help:      "Latency from etcd object created to etcd cluster running",
		})

	// EtcdSyncTotal observes the total number of etcd synchronizations since the start of Controller
	EtcdSyncTotal = metrics.NewCounter(
		&metrics.CounterOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_sync_total",
			Help:      "Total number of etcd synchronizations since the start of Controller",
		})

	// EtcdSyncSucceedTotal observes the total number of successful etcd synchronizations since the start of Controller
	EtcdSyncSucceedTotal = metrics.NewCounter(
		&metrics.CounterOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_sync_succeed_total",
			Help:      "Total number of successful etcd synchronizations since the start of Controller",
		})

	// EtcdSyncFailedTotal observes the total number of failed etcd synchronizations since the start of Controller
	EtcdSyncFailedTotal = metrics.NewCounterVec(
		&metrics.CounterOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_sync_failed_total",
			Help:      "The total number of failed etcd synchronizations since the start of Controller",
		},
		[]string{
			"reason",
		},
	)

	// ClustersTotal observes the total number of etcd managed by Controller
	ClustersTotal = metrics.NewGauge(&metrics.GaugeOpts{
		Namespace: Namespace,
		Subsystem: EtcdControllerSubsystem,
		Name:      "etcds_total",
		Help:      "Total number of etcd managed by the controller",
	})

	// EtcdSyncTimeCost observe the time cost for etcd cluster sync once
	EtcdSyncTimeCost = metrics.NewSummary(
		&metrics.SummaryOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_sync_time_cost",
			Help:      "The time cost for etcd cluster sync once",
		},
	)

	// EtcdSyncInterval observe the time interval between two synchronizations of etcd
	EtcdSyncInterval = metrics.NewSummary(
		&metrics.SummaryOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_sync_time_interval",
			Help:      "The time interval between two synchronizations of etcd",
		},
	)

	// EtcdStatusSyncInterval observe the time interval between two synchronizations of etcd status
	EtcdStatusSyncInterval = metrics.NewSummary(
		&metrics.SummaryOpts{
			Namespace: Namespace,
			Subsystem: EtcdControllerSubsystem,
			Name:      "etcd_status_sync_time_interval",
			Help:      "The time interval between two synchronizations of etcd status",
		},
	)
)

Functions

func RecordEtcdRunningLatency

func RecordEtcdRunningLatency(latency time.Duration)

RecordEtcdRunningLatency record the latency from etcd creating to running

func RecordEtcdStatusSyncTimeInterval

func RecordEtcdStatusSyncTimeInterval(cost time.Duration)

RecordEtcdStatusSyncTimeInterval record the time interval between two synchronizations of etcd status

func RecordEtcdSyncTimeCost

func RecordEtcdSyncTimeCost(cost time.Duration)

RecordEtcdSyncTimeCost records the time cost for etcd cluster sync once

func RecordEtcdSyncTimeInterval

func RecordEtcdSyncTimeInterval(cost time.Duration)

RecordEtcdSyncTimeInterval record the time interval between two synchronizations of etcd

func Register

func Register()

Register registers etcd controller metrics.

Types

This section is empty.

Jump to

Keyboard shortcuts

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