Documentation
¶
Index ¶
- Constants
- Variables
- func HandleSubclusterDelete(vdb *vapi.VerticaDB, scOid string, log logr.Logger)
- func HandleVDBDelete(namespaceName, vdbName string, log logr.Logger)
- func HandleVDBInit(vdb *vapi.VerticaDB)
- func MakeSubclusterLabels(vdb *vapi.VerticaDB, scOid 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 = "vertica"
// 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.
NamespaceLabel = "namespace"
VerticaDBLabel = "verticadb"
SubclusterOidLabel = "subcluster_oid"
ReviveInstanceIDLabel = "revive_instance_id"
)
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{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
ClusterRestartAttempt = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: Namespace,
Subsystem: ClusterRestartSubsystem,
Name: "attempted_total",
Help: "The number of times we attempted a full cluster restart",
},
[]string{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
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{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
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{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
NodesRestartAttempt = prometheus.NewCounterVec(
prometheus.CounterOpts{
Namespace: Namespace,
Subsystem: NodesRestartSubsystem,
Name: "attempted_total",
Help: "The number of times we attempted to restart down nodes",
},
[]string{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
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{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
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{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
SubclusterCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: Namespace,
Subsystem: SubclusterSubsystem,
Name: "count",
Help: "The number of subclusters that exist",
},
[]string{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel},
)
TotalNodeCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: Namespace,
Name: "total_nodes_count",
Help: "The number of nodes that currently exist",
},
[]string{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel, SubclusterOidLabel},
)
RunningNodeCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: Namespace,
Name: "running_nodes_count",
Help: "The number of nodes that have a running pod associated with it",
},
[]string{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel, SubclusterOidLabel},
)
UpNodeCount = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: Namespace,
Name: "up_nodes_count",
Help: "The number of nodes that have vertica running and can accept connections",
},
[]string{NamespaceLabel, VerticaDBLabel, ReviveInstanceIDLabel, SubclusterOidLabel},
)
)
Functions ¶
func HandleSubclusterDelete ¶
func HandleSubclusterDelete(vdb *vapi.VerticaDB, scOid 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(namespaceName, 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, scOid 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.