metrics

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// LabelSucceeded is a metric label indicating whether associated metric
	// series is for success or failure.
	LabelSucceeded = "succeeded"
	// ValueSucceededTrue is value True for metric label succeeded.
	ValueSucceededTrue = "true"
	// ValueSucceededFalse is value False for metric label failed.
	ValueSucceededFalse = "false"
	// ValueRestoreSingleMemberInMultiNode is value for metric of single member restoration in multi-node.
	ValueRestoreSingleMemberInMultiNode = "single_member"
	// ValueRestoreSingleNode is value for metric of single node restoration.
	ValueRestoreSingleNode = "single_node"
	// LabelKind is a metrics label indicates kind of snapshot associated with metric.
	LabelKind = "kind"
	// LabelError is a metric error to indicate error occured.
	LabelError = "error"
	// LabelRestorationKind metric label indicates kind of restoration associated with metric.
	LabelRestorationKind = "restore"
	// LabelEndPoint is metric label for metric of etcd cluster endpoint.
	LabelEndPoint = "endpoint"
)

Variables

View Source
var (

	// GCSnapshotCounter is metric to count the garbage collected snapshots.
	GCSnapshotCounter = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapshot,
			Name:      "gc_total",
			Help:      "Total number of garbage collected snapshots.",
		},
		[]string{LabelKind, LabelSucceeded},
	)

	// LatestSnapshotRevision is metric to expose latest snapshot revision.
	LatestSnapshotRevision = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapshot,
			Name:      "latest_revision",
			Help:      "Revision number of latest snapshot taken.",
		},
		[]string{LabelKind},
	)

	// LatestSnapshotTimestamp is metric to expose latest snapshot timestamp.
	LatestSnapshotTimestamp = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapshot,
			Name:      "latest_timestamp",
			Help:      "Timestamp of latest snapshot taken.",
		},
		[]string{LabelKind},
	)

	// SnapshotRequired is metric to expose snapshot required flag.
	SnapshotRequired = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapshot,
			Name:      "required",
			Help:      "Indicates whether a snapshot is required to be taken.",
		},
		[]string{LabelKind},
	)

	// SnapshotDurationSeconds is metric to expose the duration required to save snapshot in seconds.
	SnapshotDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapshot,
			Name:      "duration_seconds",
			Help:      "Total latency distribution of saving snapshot to object store.",
		},
		[]string{LabelKind, LabelSucceeded},
	)

	// ValidationDurationSeconds is metric to expose the duration required to validate the etcd data directory in seconds.
	ValidationDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Name:      "validation_duration_seconds",
			Help:      "Total latency distribution of validating data directory.",
		},
		[]string{LabelSucceeded},
	)

	// RestorationDurationSeconds is metric to expose the duration required to restore the etcd member.
	RestorationDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemRestore,
			Name:      "duration_seconds",
			Help:      "Total latency distribution required to restore the etcd member.",
		},
		[]string{LabelRestorationKind, LabelSucceeded},
	)

	// DefragmentationDurationSeconds is metric to expose duration required to defragment all the members of etcd cluster.
	DefragmentationDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Name:      "defragmentation_duration_seconds",
			Help:      "Total latency distribution of defragmentation of each etcd cluster member.",
		},
		[]string{LabelSucceeded, LabelEndPoint},
	)

	// SnapstoreLatestDeltasTotal is metric to expose total number of delta snapshots taken since the latest full snapshot.
	SnapstoreLatestDeltasTotal = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapstore,
			Name:      "latest_deltas_total",
			Help:      "Total number of delta snapshots taken since the latest full snapshot.",
		},
		[]string{},
	)
	// SnapstoreLatestDeltasRevisionsTotal is metric to expose total number of revisions stored in delta snapshots taken since the latest full snapshot.
	SnapstoreLatestDeltasRevisionsTotal = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapstore,
			Name:      "latest_deltas_revisions_total",
			Help:      "Total number of revisions stored in delta snapshots taken since the latest full snapshot.",
		},
		[]string{},
	)

	//SnapshotterOperationFailure is metric to count the number of snapshotter operations that have errored out
	SnapshotterOperationFailure = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespaceEtcdBR,
			Subsystem: subsystemSnapshotter,
			Name:      "failure",
			Help:      "Total number of snapshotter errors.",
		},
		[]string{LabelError},
	)

	// CurrentClusterSize is metric to expose the current Etcd cluster size.
	CurrentClusterSize = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Name:      "cluster_size",
			Help:      "Current Etcd cluster size.",
		},
		[]string{},
	)

	// IsLearner is metric to expose whether or not this member is a learner.
	IsLearner = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Namespace: namespaceEtcdBR,
			Name:      "is_learner",
			Help:      "Whether or not this member is a learner. 1 if is, 0 otherwise",
		},
		[]string{},
	)

	// IsLearnerCountTotal is metric to expose the total count when etcd member added as a learner.
	IsLearnerCountTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: namespaceEtcdBR,
			Name:      "is_learner_count_total",
			Help:      "Total count when etcd member added as a learner.",
		},
		[]string{LabelSucceeded},
	)

	// AddLearnerDurationSeconds is metric to expose duration required to add member as a learner.
	AddLearnerDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Name:      "add_learner_duration_seconds",
			Help:      "Total latency to add the etcd member as a learner to the cluster.",
		},
		[]string{LabelSucceeded},
	)

	// MemberRemoveDurationSeconds is metric to expose duration required to remove a member from the cluster.
	MemberRemoveDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Name:      "member_remove_duration_seconds",
			Help:      "Total latency to remove the etcd member from the cluster.",
		},
		[]string{LabelSucceeded},
	)

	// MemberPromoteDurationSeconds is metric to expose duration required to promote the learner to the voting member.
	MemberPromoteDurationSeconds = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: namespaceEtcdBR,
			Name:      "member_promote_duration_seconds",
			Help:      "Total latency to promote the learner to the voting member.",
		},
		[]string{LabelSucceeded},
	)
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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