metrics

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: GPL-2.0, GPL-3.0 Imports: 1 Imported by: 0

Documentation

Overview

Package metrics defines knell's Prometheus metrics and the registry that serves them. Metrics are package-level singletons registered once at init (registration only panics on programmer error: a duplicate or invalid name); the exposition prefix is "knell_".

Index

Constants

This section is empty.

Variables

View Source
var BeatFresh = metricslib.NewLabeledGauge(
	"beat_fresh",
	"Whether the beat's last ping is within its deadline (1 = fresh, 0 = overdue).",
	[]string{beatLabel},
)

BeatFresh reports per beat whether the last ping is within its deadline (1) or the beat is overdue (0). This is the aggregation input for multi-observer quorum rules.

View Source
var BeatLastSeen = metricslib.NewLabeledGauge(
	"beat_last_seen_timestamp_seconds",
	"Unix timestamp of the beat's last accepted ping (process start until the first ping).",
	[]string{beatLabel},
)

BeatLastSeen is the Unix timestamp of each beat's last accepted ping. Until a first ping arrives it carries the process start time (the boot baseline the deadline counts from).

View Source
var BeatsReceived = metricslib.NewLabeledCounter(
	"beats_received_total",
	"Accepted pings per beat (unknown ids are rejected and not counted).",
	[]string{beatLabel},
)

BeatsReceived counts accepted pings per beat. Unknown beat ids are rejected with 404 and deliberately not counted (the id is a label; counting arbitrary request paths would let callers mint unbounded series).

View Source
var NotificationsFailed = metricslib.NewLabeledCounter(
	"notifications_failed_total",
	"Webhook notifications that failed after retries, by kind (missing, recovered).",
	[]string{"kind"},
)

NotificationsFailed counts webhook notifications that failed after retries, by kind. A missing notification that fails is retried on the next watch tick; a recovered notification is best-effort.

View Source
var NotificationsSent = metricslib.NewLabeledCounter(
	"notifications_sent_total",
	"Webhook notifications delivered, by kind (missing, recovered).",
	[]string{"kind"},
)

NotificationsSent counts webhook notifications delivered, by kind (missing, recovered).

View Source
var Registry = metricslib.NewRegistry("knell")

Registry serves every registered metric plus process metrics on /metrics.

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