Skip to content

ateom-gvisor: emit actor usage records - #2194

Open
Tim Bai (baizhenyu) wants to merge 1 commit into
agent-substrate:mainfrom
baizhenyu:ateom-usage-gvisor
Open

Tim Bai (baizhenyu) wants to merge 1 commit into
agent-substrate:mainfrom
baizhenyu:ateom-usage-gvisor

Conversation

@baizhenyu

Copy link
Copy Markdown
Collaborator

Part of #1748, split out of #1984: the gVisor ateom emits the actor usage records, using #2005's building blocks. #1984 keeps the atelet side.

  • Sampling. The ateom samples its actors every --usage-sample-interval (default 1m) and writes one ate.actor.usage_sampled record per actor per sample.
  • Order. Per activation: initial when it starts, then periodic, then final after a checkpoint or terminate succeeds. The final reading is taken before the snapshot, because a Full checkpoint stops the sandbox's cgroup.
  • Discovery read. GetActiveWorkloadStats serves the latest sample, so atelet's poll reads no cgroup.
  • Re-host. A read goes through the activation's own state, so a re-host during it cannot mix two activations' numbers.

Until #1984 lands, atelet still writes its own stdout usage record, so each gVisor actor has two usage records, with different messages and keys.

Tested: unit tests. The combined change was tested on ate-dev earlier, with initial, periodic, and final per epoch for both checkpoint and terminate.

The gVisor ateom now samples its actors on its own timer
(--usage-sample-interval, default 1m) and writes one ate.actor.usage_sampled
record per actor per sample. An activation also gets an initial record when it
starts and a final one after a checkpoint or terminate succeeds, in that order.
GetActiveWorkloadStats serves the latest sample, so a poll reads no cgroup.

Every read goes through the activation's own state, so a re-host during a read
cannot mix two activations' numbers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/observability kind/feature An enhancement / feature request or implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant