Documentation
¶
Overview ¶
Package metrics exposes runtime counters in Prometheus text format.
Written by hand rather than with client_golang. The data already exists as atomics on each node runner, the exposition format is small and stable, and the library would add a couple of megabytes to a binary whose whole argument is that it is small. What the library buys — label escaping, consistent HELP/TYPE emission, collision safety — is reproduced here deliberately rather than skipped.
Node-RED exposes nothing comparable. Per-node message counts, error counts and queue depth are the difference between knowing a flow is backing up and finding out when the pod is OOM-killed.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the metrics endpoint.
func NewHandler ¶
NewHandler builds the endpoint.
type NodeStat ¶
type NodeStat struct {
NodeID string
Type string
Received int64
Sent int64
Errors int64
Dropped int64
Blocked int64
QueueLen int
QueueCap int
QueueHigh int64
}
NodeStat is one node's counters. Mirrors runtime.Snapshot, kept separate so this package does not depend on the runtime and can be tested on its own.