metrics

package
v1.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// The namespace for all metrics.  This ends up being a prefix of the name
	// of each of the metrics.
	Namespace = "verticadb"

	// The subsystem is the second part of the name.  This comes after the
	// namespace and before the metric name.
	UpgradeSubsystem        = "upgrade"
	ClusterRestartSubsystem = "cluster_restart"
	NodesRestartSubsystem   = "nodes_restart"
	SubclusterSubsystem     = "subclusters"

	// Names of the labels that we can apply to metrics.
	VerticaDBLabel  = "verticadb"
	SubclusterLabel = "subcluster"
)

Variables

View Source
var (
	AdminToolsBucket = []float64{1, 5, 10, 30, 60, 120, 300, 600}

	UpgradeCount = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: UpgradeSubsystem,
			Name:      "total",
			Help:      "The number of times the operator performed an upgrade caused by an image change",
		},
		[]string{VerticaDBLabel},
	)
	ClusterRestartAttempt = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: ClusterRestartSubsystem,
			Name:      "attempted_total",
			Help:      "The number of times we attempted a full cluster restart",
		},
		[]string{VerticaDBLabel},
	)
	ClusterRestartFailure = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: ClusterRestartSubsystem,
			Name:      "failed_total",
			Help:      "The number of times we failed when attempting a full cluster restart",
		},
		[]string{VerticaDBLabel},
	)
	ClusterRestartDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: Namespace,
			Subsystem: ClusterRestartSubsystem,
			Name:      "seconds",
			Help:      "The number of seconds it took to do a full cluster restart",
			Buckets:   AdminToolsBucket,
		},
		[]string{VerticaDBLabel},
	)
	NodesRestartAttempt = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: NodesRestartSubsystem,
			Name:      "attempted_total",
			Help:      "The number of times we attempted to restart down nodes",
		},
		[]string{VerticaDBLabel},
	)
	NodesRestartFailed = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: Namespace,
			Subsystem: NodesRestartSubsystem,
			Name:      "failed_total",
			Help:      "The number of times we failed when trying to restart down nodes",
		},
		[]string{VerticaDBLabel},
	)
	NodesRestartDuration = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: Namespace,
			Subsystem: NodesRestartSubsystem,
			Name:      "seconds",
			Help:      "The number of seconds it took to restart down nodes",
			Buckets:   AdminToolsBucket,
		},
		[]string{VerticaDBLabel},
	)
	SubclusterCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: Namespace,
			Subsystem: SubclusterSubsystem,
			Name:      "count",
			Help:      "The number of subclusters that exist",
		},
		[]string{VerticaDBLabel},
	)
	SubclusterPodCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: Namespace,
			Subsystem: SubclusterSubsystem,
			Name:      "pod_count",
			Help:      "The number of pods that currently exist in a subcluster",
		},
		[]string{VerticaDBLabel, SubclusterLabel},
	)
	SubclusterRunningPodCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: Namespace,
			Subsystem: SubclusterSubsystem,
			Name:      "running_pod_count",
			Help:      "The number of running pods in a subcluster",
		},
		[]string{VerticaDBLabel, SubclusterLabel},
	)
	SubclusterReadyPodCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: Namespace,
			Subsystem: SubclusterSubsystem,
			Name:      "ready_pod_count",
			Help:      "The number of pods in a subcluster that have vertica running and accepting connections",
		},
		[]string{VerticaDBLabel, SubclusterLabel},
	)
)

Functions

func HandleSubclusterDelete

func HandleSubclusterDelete(vdb *vapi.VerticaDB, scName string, log logr.Logger)

HandleSubclusterDelete will cleanup metrics upon subcluster deletion. It will clear out any metrics that are subcluster specific.

func HandleVDBDelete

func HandleVDBDelete(vdbName string, log logr.Logger)

HandleVDBDelete will cleanup metrics when we find out that the VerticaDB no longer exists. This should include all metrics that include the VerticaDB name in its metrics.

func HandleVDBInit

func HandleVDBInit(vdb *vapi.VerticaDB)

HandleVDBInit will initialized metrics that use verticadb as a label. This is necessary to fill in a missing series with a known verticaDB. Otherwise, a metric won't be displayed until we have set some value to it. This may break dashboards that assume the metric exists.

func MakeSubclusterLabels

func MakeSubclusterLabels(vdb *vapi.VerticaDB, scName string) prometheus.Labels

MakeSubclusterLabels returns a prometheus.Labels that includes the VerticaDB and subcluster name.

func MakeVDBLabels

func MakeVDBLabels(vdb *vapi.VerticaDB) prometheus.Labels

MakeVDBLabels return a prometheus.Labels that includes the VerticaDB name

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳