Skip to content

Conversation

@scottopell
Copy link
Contributor

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

Related issues

A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.

Additional Notes

Anything else we should know when reviewing?

Copy link
Contributor Author

scottopell commented Jan 14, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

The CPU samplers (both cgroup v2 and procfs) were initializing prev
stats to zeros, causing the first delta calculation to be
(cumulative_since_container_start - 0) which produces an enormous
spike in total_cpu_usage_millicores.

Fix by making prev an Option<Stats>. On first poll, we record baseline
stats but skip metric emission. Subsequent polls compute proper deltas.

Changes:
- cgroup/v2/cpu: Make prev Option<Stats>, skip first poll emission
- procfs/stat: Make prev Option<Stats>, skip first poll emission

Ports commits 5d51345 and 706bc95 from sopell/expose-observer-public
to the extracted lading-observer crate.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@scottopell scottopell changed the base branch from dd/extract-lading-observer-crate to graphite-base/1706 January 15, 2026 18:44
@scottopell scottopell force-pushed the sopell/observer-bugfixes branch from e192e68 to 618001c Compare January 15, 2026 18:44
@scottopell scottopell changed the base branch from graphite-base/1706 to dd/extract-lading-observer-crate-clean January 15, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants