metrics

package
v0.17.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DOWN float64 = 0
	UP   float64 = 1
)

heartbeats_heartbeat_last_status

View Source
const (
	SUCCESS float64 = 0
	ERROR   float64 = 1
)

heartbeats_receiver_last_status

Variables

View Source
var (
	// LastStatus reports the most recent status of each heartbeat (0 = DOWN, 1 = UP).
	LastStatus = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "heartbeats_heartbeat_last_status",
			Help: "Most recent status of each heartbeat (0 = DOWN, 1 = UP)",
		},
		[]string{"heartbeat"},
	)

	// ReceivedTotal counts the total number of received heartbeats per ID.
	ReceivedTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Name: "heartbeats_heartbeat_received_total",
			Help: "Total number of received heartbeats per ID",
		},
		[]string{"heartbeat"},
	)

	// ReceiverErrorStatus reports the status of the last notification attempt (1 = ERROR, 0 = SUCCESS)
	ReceiverErrorStatus = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "heartbeats_receiver_last_status",
			Help: "Reports the status of the last notification attempt (1 = ERROR, 0 = SUCCESS)",
		},
		[]string{"receiver", "type", "target"},
	)
)

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(store history.Store) *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