Documentation
¶
Overview ¶
Package telemetry owns the bounded live operational snapshot shared by dashboard, API and metrics readers. It starts no goroutine; the node's central scheduler calls Sampler.Sample.
Index ¶
Constants ¶
const ( DefaultCadence = 10 * time.Second HistoryCapacity = 180 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
Counter carries internal continuity identity and cumulative byte counters. Identity is never copied into Point, so topology cannot leak to readers.
type Issues ¶
type Issues uint32
Issues is a bounded bitset of stable, non-secret health reasons.
const ( IssueAWGInterfaceMissing IssueReadinessFailed IssueAccountingError IssueSampleStale )
type Point ¶
type Point struct {
At time.Time
CPUPercent Metric
MemoryUsedBytes UintMetric
MemoryTotalBytes UintMetric
MemoryPercent Metric
DiskUsedBytes UintMetric
DiskTotalBytes UintMetric
DiskPercent Metric
Load1 Metric
UptimeSeconds UintMetric
ProcessRSSBytes UintMetric
ProcessHeapBytes UintMetric
Goroutines UintMetric
HostRXBytes UintMetric
HostTXBytes UintMetric
VPNRXBytes UintMetric
VPNTXBytes UintMetric
HostRXRate Metric
HostTXRate Metric
VPNRXRate Metric
VPNTXRate Metric
OnlineUsers UintMetric
ActivePeers UintMetric
EnabledInterfaces UintMetric
ObservedInterfaces UintMetric
Health Health
Issues Issues
}
Point is a value-only public telemetry point. It deliberately contains no interface names, subprocess errors, database errors or other topology.
type RawSample ¶
type RawSample struct {
At time.Time
HostAvailable bool
CPUPercent *float64
MemTotalBytes uint64
MemAvailableBytes uint64
DiskTotalBytes uint64
DiskFreeBytes uint64
Load1 *float64
Uptime time.Duration
ProcessRSSBytes uint64
ProcessHeapBytes uint64
ProcessMetricsAvailable bool
Goroutines uint64
HostNetwork Counter
VPNNetwork Counter
OnlineUsers uint64
ActivePeers uint64
ActivityAvailable bool
EnabledInterfaces uint64
ObservedInterfaces uint64
InterfacesAvailable bool
Ready bool
ReadinessAvailable bool
RecentAccountingError bool
AccountingAvailable bool
}
RawSample is the collector-to-sampler contract. Availability flags make a real zero distinct from a source that could not be read.
type Sampler ¶
type Sampler struct {
// contains filtered or unexported fields
}
Sampler derives rates/health and owns the fixed-size history ring.
type Source ¶
Source collects one raw point. Implementations may return partial metrics; an error means the sample as a whole is unavailable and its details must be sent only to protected logs.
type SourceFunc ¶
SourceFunc adapts a function to Source.
type UintMetric ¶
UintMetric is an exact integer measurement whose zero can be meaningful.