Documentation
¶
Index ¶
- Constants
- Variables
- func HandleSubclusterDelete(vdb *vapi.VerticaDB, scName string, log logr.Logger)
- func HandleVDBDelete(vdbName string, log logr.Logger)
- func HandleVDBInit(vdb *vapi.VerticaDB)
- func MakeSubclusterLabels(vdb *vapi.VerticaDB, scName string) prometheus.Labels
- func MakeVDBLabels(vdb *vapi.VerticaDB) prometheus.Labels
Constants ¶
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 ¶
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 ¶
HandleSubclusterDelete will cleanup metrics upon subcluster deletion. It will clear out any metrics that are subcluster specific.
func HandleVDBDelete ¶
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 ¶
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.