metrics

package
v0.9.3 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOWN = iota
	UP
)

Variables

View Source
var (
	// HeartbeatStatus is a gauge metric representing the last status of each heartbeat.
	HeartbeatStatus = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "heartbeats_heartbeat_last_status",
			Help: "Total number of heartbeats",
		},
		[]string{"heartbeat"},
	)

	// TotalHeartbeats is a counter metric tracking the total number of heartbeats.
	TotalHeartbeats = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "heartbeats_heartbeats_total",
			Help: "The total number of heartbeats",
		},
		[]string{"heartbeat"},
	)
)
View Source
var PromMetrics = NewMetrics()

PromMetrics holds the global instance of Metrics.

Functions

This section is empty.

Types

type Metrics

type Metrics struct {
	Registry *prometheus.Registry
}

Metrics wraps a Prometheus registry and provides functionality for metric registration.

func NewMetrics

func NewMetrics() *Metrics

NewMetrics creates and initializes a new Metrics instance with all relevant metrics registered.

Jump to

Keyboard shortcuts

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