Skip to content

Add opt-in guest metrics for selected microVM actors - #3793

Open
Shichun Feng (Sean) (KeyOfSpectator) wants to merge 2 commits into
agent-substrate:mainfrom
KeyOfSpectator:codex/actor-guest-debug-metrics
Open

Shichun Feng (Sean) (KeyOfSpectator) wants to merge 2 commits into
agent-substrate:mainfrom
KeyOfSpectator:codex/actor-guest-debug-metrics

Conversation

@KeyOfSpectator

@KeyOfSpectator Shichun Feng (Sean) (KeyOfSpectator) commented Nov 11, 2026 •

Copy link
Copy Markdown

Operators who know which microVM actors to watch can plot guest CPU and memory using the existing Prometheus scrape of atelet’s /metrics. The existing ate_actor_stats_* series still serve dashboards grouped by template and worker pool.

Set --debug-actor-guest-metrics-uids to expose the new series for up to 16 actor UIDs per atelet. An empty list disables them. The series reuse cached guest samples and are visible to readers of the scrape endpoint when enabled.

ate_debug_actor_guest_cpu_usage_cores{actor_atespace="demo",actor_name="runner-17",actor_uid="c7f3fb50-ef2d-4075-b59a-4a8e192e48a0"} 0.75
ate_debug_actor_guest_memory_usage_bytes{actor_atespace="demo",actor_name="runner-17",actor_uid="c7f3fb50-ef2d-4075-b59a-4a8e192e48a0"} 402653184
ate_debug_actor_guest_memory_working_set_bytes{actor_atespace="demo",actor_name="runner-17",actor_uid="c7f3fb50-ef2d-4075-b59a-4a8e192e48a0"} 335544320

CPU appears after two distinct samples in the same activation. For spikes that predate the allowlist, retained ate.actor.usage_sampled events can provide the history. Refs #3792.

Passed go test -race ./cmd/atelet ./internal/serverboot -count=3 -shuffle=on. The full local suite had failures in other packages. The registry check needs Weaver or Docker.

AI use: Codex helped prepare the patch, tests, and PR description.

  • Docs updated

Signed-off-by: Shichun Feng (Sean) <keyofspectator@gmail.com>
@KeyOfSpectator

Copy link
Copy Markdown
Author

Tim Bai (@baizhenyu) Krisztian F (@krisztianfekete)
Hi, could you take a quick look at the design in this draft? It reuses the existing guest samples and exposes metrics for explicitly selected actors on a separate, opt-in debug endpoint. Does that fit the project's approach to metric cardinality?

In real-world use cases, we’d like to add actor metadata labels to guest CPU and memory metrics so users can tell which actor each time series belongs to.

@KeyOfSpectator
Shichun Feng (Sean) (KeyOfSpectator) marked this pull request as ready for review November 11, 2026 08:00
@KeyOfSpectator

Copy link
Copy Markdown
Author

Krisztian F (@krisztianfekete) Could a maintainer approve the pending workflows on this PR so the e2e checks can run? Thanks!

@krisztianfekete Krisztian F (krisztianfekete) added kind/design Design discussion, investigation, or research required before implementation DO NOT MERGE This PR must not be merged yet. labels Nov 11, 2026
@KeyOfSpectator

Shichun Feng (Sean) (KeyOfSpectator) commented Nov 13, 2026 •

Copy link
Copy Markdown
Author

Thanks, Krisztian F (@krisztianfekete). I misunderstood the use case when I proposed a separate debug endpoint. I’ve updated the PR so our existing Prometheus scrape of atelet’s /metrics can collect a separate set of per-actor guest CPU and memory metrics. The new series are off by default and limited to 16 explicitly configured actor UIDs per atelet. The existing aggregate metrics continue to serve the current dashboards.

We want to look back at the CPU and memory history of individual actors during a workload run. For example, in reinforcement learning, we want to see how much guest CPU and memory an actor running a rollout worker used during a particular phase of training. We can join the resource series with our workload metadata using actor_atespace and actor_name to identify the workload and its role. actor_uid lets us distinguish actors recreated under the same name.

You’re right that the allowlist has to be configured before the run to build that history in Prometheus. For an actor we didn’t select beforehand, we can look back at retained ate.actor.usage_sampled events. Would the revised opt-in design fit the project’s cardinality policy?

Signed-off-by: Shichun Feng (Sean) <keyofspectator@gmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DO NOT MERGE This PR must not be merged yet. kind/design Design discussion, investigation, or research required before implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants