Documentation
¶
Overview ¶
Package metrics is the host's Prometheus registry: the admission stage histogram (R1), the per-object work histograms (R2), CPU attribution (R3) and the submit/lookup counters, all under the overlay_go_ prefix.
Every labelled series with a bounded label set is created at zero at startup. A counter that is absent until its first event matches nothing in a rate() and reads exactly like a healthy host, which is the silent failure an alert on it exists to catch.
Index ¶
Constants ¶
const ( ModuleMulti = "multi" ModuleNone = "none" )
Module label values beside the mounted module names: a submission whose topics belong to more than one module, and one with no mounted owner (a host never answers one, so a series under it is a bug).
const ( ResultOK = "ok" // the engine answered a STEAK ResultMalformed = "malformed" // bad header, body or BEEF: the client's fault ResultRefused = "refused" // SPV or the fee floor refused the object ResultPending = "pending" // kept for label stability; the ordinary path never answers it ResultError = "error" // the engine or storage failed )
Submit results, the label values of overlay_go_submits_total.
const Namespace = "overlay_go"
Namespace is the metric-name prefix of every family this host emits.
Variables ¶
var ( GASPSyncResults = []string{"ok", "incomplete", "peer-error", "error"} GASPObjectResults = []string{"admitted", "duplicate", "refused", "retry", "failed", "skipped"} GASPRoutes = []string{"sync", "node"} GASPServedResults = []string{"ok", "malformed", "unknown-topic", "replay-only", "not-found", "forbidden", "limited", "error"} )
GASP results: the result label values of overlay_go_gasp_syncs_total, overlay_go_gasp_objects_total and overlay_go_gasp_served_total.
var ( ReplayRoundResults = []string{"ok", "incomplete", "peer-error", "error"} ReplayObjectResults = []string{"admitted", "duplicate", "refused", "retry", "failed", "waiting", "skipped"} ReplayQuestionResults = []string{"ok", "refused"} )
Replay results: the result label values of overlay_go_replay_rounds_total, overlay_go_replay_objects_total and overlay_go_replay_questions_total.
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct {
Reg *prometheus.Registry
Submits *prometheus.CounterVec
TopicSubmits *prometheus.CounterVec
Admissions *prometheus.CounterVec
TopicFailures *prometheus.CounterVec
Lookups *prometheus.CounterVec
Verify *prometheus.CounterVec
Stage *prometheus.HistogramVec
Admission *prometheus.HistogramVec
ObjectTransactions prometheus.Histogram
ObjectInputs prometheus.Histogram
ObjectDepth prometheus.Histogram
Ready prometheus.Gauge
ReconcileTip prometheus.Gauge
Reconciles *prometheus.CounterVec
BuildInfo *prometheus.GaugeVec
Duplicates *prometheus.CounterVec
// Storage (pkg/store).
StoreInfo *prometheus.GaugeVec
StoreOps *prometheus.HistogramVec
StoreWALSyncs prometheus.Counter
StoreWALSync prometheus.Histogram
RetentionRuns *prometheus.CounterVec
RetentionRun prometheus.Histogram
RetentionUnlinked prometheus.Counter
RetentionBytes prometheus.Counter
RetentionCandidates prometheus.Gauge
Checkpoints *prometheus.CounterVec
// GASP catch-up (internal/catchup). PresetGASP creates the per-peer and
// per-topic series once the peers and the topics GASP carries are known.
GASPSyncs *prometheus.CounterVec
GASPObjects *prometheus.CounterVec
GASPNodes *prometheus.CounterVec
GASPServed *prometheus.CounterVec
GASPSync prometheus.Histogram
GASPPeers prometheus.Gauge
// Ordered replay (internal/catchup, ruling R-o): the topics GASP never
// carries, repaired by their module's replayer from the same peers.
// PresetReplay creates the series once the peers and topics are known.
ReplayRounds *prometheus.CounterVec
ReplayObjects *prometheus.CounterVec
ReplayQuestions *prometheus.CounterVec
ReplayGaps *prometheus.GaugeVec
ReplayRound prometheus.Histogram
ReplayTopics prometheus.Gauge
}
Metrics holds every family. Create it with New.
func New ¶
New builds the registry. topics are the topics the host carries, so their per-topic series exist at zero from the start.
func (*Metrics) ObserveStages ¶
ObserveStages records every stage that ran, under the submission's module.
func (*Metrics) PresetGASP ¶ added in v0.7.0
PresetGASP creates the catch-up series of every peer and every topic GASP carries at zero, so an alert or a rate reads them before the first event.
func (*Metrics) PresetModules ¶ added in v0.6.0
PresetModules creates the stage and admission series of every mounted module at zero (and of multi, when more than one is mounted), so a module that has admitted nothing yet shows zero rather than no series. The host calls it once the modules are mounted.
func (*Metrics) PresetReplay ¶ added in v0.9.0
PresetReplay creates the replay series of every peer and every topic a module repairs by replay.
type Stage ¶
type Stage int
Stage is one step of an admission, a label value of overlay_go_admission_stage_seconds.
const ( StageParse Stage = iota // BEEF bytes to a transaction graph StageMerkle // merkle roots and the tip, asked of the chain tracker StageScripts // everything else SPV does: scripts, amounts, structure StageFee // the subject's fee against the configured floor StageLock // waiting for the submission's topic locks StageAdmit // topic managers' IdentifyAdmissibleOutputs, all topics StagePayload // the BEEF blob write StageCommit // the index writes StageNotify // lookup services told of admitted and spent outputs )
The stages, in the order an admission runs them.
type Stages ¶
type Stages struct {
// contains filtered or unexported fields
}
Stages accumulates stage durations for one submission. Code that runs inside the engine (topic managers, storage) finds it in the context and adds to it; the pipeline observes the totals once, so a stage that runs several times per object (a payload per admitted output) is one sample.
func StagesFrom ¶
StagesFrom returns the accumulator in ctx, or nil.
func WithStages ¶
WithStages returns a context carrying a fresh accumulator.