observability

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package observability collects on-demand operational observations without changing the subsystems being observed.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HostSnapshot

type HostSnapshot struct {
	ObservedAt          time.Time `json:"observed_at"`
	ProcessRSSBytes     HostValue `json:"process_rss_bytes"`
	OpenFDs             HostValue `json:"open_fds"`
	StateAvailableBytes HostValue `json:"state_available_bytes"`
	StateCapacityBytes  HostValue `json:"state_capacity_bytes"`
}

HostSnapshot describes this process and the filesystem containing its state. Fields are observed sequentially, not as an atomic system-wide snapshot.

func CollectHost

func CollectHost(stateDir string) HostSnapshot

CollectHost reads Linux's current process RSS, open descriptor count and available/capacity bytes for the filesystem containing stateDir. stateDir must be on a local filesystem. Reads and descriptor enumeration are size-bounded; kernel filesystem calls have no imposed deadline. RSS accounting scans the process mappings, so collection is on demand rather than constant-time.

type HostValue

type HostValue struct {
	Value       *uint64 `json:"value"`
	Unavailable string  `json:"unavailable,omitempty"`
}

HostValue is either an observation or a fixed reason it could not be read. An unavailable value is null, never an inferred zero. Reasons do not include paths or operating-system error text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL