Documentation
¶
Overview ¶
Package observability owns low-cardinality process metrics and the redacted operational state served by the management endpoint.
Index ¶
- func NewJSONLogger(w io.Writer, level slog.Level) *slog.Logger
- func RedactText(value string) string
- func RedactingHandler(next slog.Handler) slog.Handler
- type Collector
- type ComponentState
- type DNSResolution
- type DNSSnapshot
- type GroupSnapshot
- type ManagementConfig
- type ManagementServer
- type ProbeSnapshot
- type ProxySnapshot
- type Registry
- func (r *Registry) Ready() (bool, []string)
- func (r *Registry) RecordPfSync(outcome string, resultErrors ...error)
- func (r *Registry) RecordReload(outcome string, duration time.Duration)
- func (r *Registry) SeriesCount() int
- func (r *Registry) SetActiveGeneration(g lifecycle.Generation)
- func (r *Registry) SetComponent(name string, required, ready bool, outcome string, err error)
- func (r *Registry) SetDNS(snapshot DNSSnapshot)
- func (r *Registry) SetDrift(kernel, firewall int)
- func (r *Registry) SetGroups(snapshots []GroupSnapshot)
- func (r *Registry) SetProbe(snapshot ProbeSnapshot)
- func (r *Registry) SetProxy(snapshot ProxySnapshot)
- func (r *Registry) SetRouteSource(snapshot RouteSourceSnapshot)
- func (r *Registry) SetWG(snapshots []WGSnapshot)
- func (r *Registry) Status() Status
- func (r *Registry) WritePrometheus(w io.Writer)
- func (r *Registry) WriteStatus(w io.Writer) error
- type RouteSourceSnapshot
- type Status
- type WGSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedactText ¶
RedactText removes credential-bearing URLs, common secret assignments, and PEM/SSH material from errors before they reach logs or status responses.
Types ¶
type ComponentState ¶
type DNSResolution ¶
type DNSSnapshot ¶
type GroupSnapshot ¶
type ManagementConfig ¶
type ManagementServer ¶
type ManagementServer struct {
// contains filtered or unexported fields
}
func NewManagementServer ¶
func NewManagementServer(config ManagementConfig, registry *Registry, collect Collector, logger *slog.Logger) (*ManagementServer, error)
func (*ManagementServer) Addr ¶
func (m *ManagementServer) Addr() net.Addr
func (*ManagementServer) Start ¶
func (m *ManagementServer) Start() error
type ProbeSnapshot ¶
type ProxySnapshot ¶
type ProxySnapshot struct {
Active int64
Accepted uint64
Rejected map[string]uint64 // protocol|reason|listener_class
Completed map[string]uint64 // completed|canceled|error|other
DurationSeconds map[string]float64
ClientBytes map[string]uint64
BackendBytes map[string]uint64
ConnectAttempts map[string]uint64 // outcome|egress_class
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
func (*Registry) RecordPfSync ¶
func (*Registry) RecordReload ¶
func (*Registry) SeriesCount ¶
func (*Registry) SetActiveGeneration ¶
func (r *Registry) SetActiveGeneration(g lifecycle.Generation)
func (*Registry) SetComponent ¶
func (*Registry) SetDNS ¶
func (r *Registry) SetDNS(snapshot DNSSnapshot)
func (*Registry) SetGroups ¶
func (r *Registry) SetGroups(snapshots []GroupSnapshot)
func (*Registry) SetProbe ¶
func (r *Registry) SetProbe(snapshot ProbeSnapshot)
func (*Registry) SetProxy ¶
func (r *Registry) SetProxy(snapshot ProxySnapshot)
func (*Registry) SetRouteSource ¶
func (r *Registry) SetRouteSource(snapshot RouteSourceSnapshot)
func (*Registry) SetWG ¶
func (r *Registry) SetWG(snapshots []WGSnapshot)
func (*Registry) WritePrometheus ¶
WritePrometheus emits a stable, dependency-free Prometheus text exposition. Every label is either a fixed enum or a configuration-bounded tunnel/source name. Hostnames, addresses, URLs, routes, and peer keys are never labels.
type RouteSourceSnapshot ¶
type Status ¶
type Status struct {
Live bool `json:"live"`
Ready bool `json:"ready"`
ReadinessReasons []string `json:"readiness_reasons,omitempty"`
Generation lifecycle.Generation `json:"active_generation"`
StartedAt time.Time `json:"started_at"`
Components map[string]ComponentState `json:"components"`
RouteSources []RouteSourceSnapshot `json:"route_sources,omitempty"`
WireGuard []WGSnapshot `json:"wireguard,omitempty"`
Groups []GroupSnapshot `json:"groups,omitempty"`
ActiveProbe *ProbeSnapshot `json:"active_probe,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.