Documentation
¶
Overview ¶
Package cgroupmetrics reports resource use for the cgroup that contains the Dagger engine process.
CPU usage and memory accounting include processes in descendant cgroups. The standard layout places accounted commands in sibling cgroups, not descendants of the engine. CPU usage values are cumulative since cgroup creation, and the total reported by the kernel is the accounting source; user and system values are diagnostic components. Memory peak is for the cgroup lifetime. Memory breakdown fields are diagnostic and can overlap. These metrics do not imply attribution to a Dagger client or organization. In the standard layout, /engine, /exec, /git, and /rg are siblings. SSHFS helpers belong below their exec. These commands and executions are not included. A different layout (including an engine at the namespace root) can include user workloads. This package observes that boundary; it does not enforce it.
CPU quota enforcement counters report only this cgroup's own quota. They exclude throttling caused by ancestor cgroups. Zero does not mean that the engine was not throttled.
Index ¶
Constants ¶
const ( InstrumentationScopeName = "dagger.io/engine.resources" CPUTimeName = "dagger.engine.cpu.time" CPUThrottledTimeName = "dagger.engine.cpu.throttled.time" CPUPeriodsName = "dagger.engine.cpu.periods" MemoryCurrentName = "dagger.engine.memory.current" MemoryPeakName = "dagger.engine.memory.peak" MemorySwapCurrentName = "dagger.engine.memory.swap.current" MemorySwapPeakName = "dagger.engine.memory.swap.peak" MemoryBreakdownName = "dagger.engine.memory.breakdown" MemoryEventsName = "dagger.engine.memory.events" CgroupDescendantsName = "dagger.engine.cgroup.descendants" ResourceAvailableName = "dagger.engine.resource_metrics.available" )
Variables ¶
This section is empty.
Functions ¶
func Register ¶
Register discovers the engine process cgroup and registers one callback that reads its cgroup v2 accounting files for each OpenTelemetry collection. Discovery and read failures are reported as availability=0 and retried at collection time. Only instrument or callback registration failures return an error. Keep the callback registered until the meter provider shuts down.
Types ¶
This section is empty.