Skip to content

Write per-VM log through a tracing layer - #150

Open
tmakatos wants to merge 3 commits into
engine-util-percentfrom
per-vm-log-layer
Open

tmakatos wants to merge 3 commits into
engine-util-percentfrom
per-vm-log-layer

Conversation

@tmakatos

Copy link
Copy Markdown
Collaborator

Every per-VM event was logged twice, once through tracing and once as
a hand-formatted line for the per-VM file, and events logged elsewhere,
such as the threshold engine's scaling decisions, never reached the
per-VM file at all.

Add a tracing layer that copies every event carrying a vm field to that
VM's file, without the vm field, and log per-VM events only once. Status
and lifecycle records use a dedicated per_vm target that the main log
filters out, so they still only go to the per-VM files. The layer has
its own INFO filter, so RUST_LOG no longer affects the per-VM files.

Use vm consistently for the VM ID field, instead of id or uuid, so that
those events are routed too.

AI-generated: everything
Signed-off-by: Thanos Makatos thanos.makatos@nutanix.com


Stack created with GitHub Stacks CLI • Give Feedback 💬

@tmakatos
tmakatos added this pull request to stack #149 October 22, 2026 11:04
@tmakatos
tmakatos force-pushed the per-vm-log-layer branch 2 times, most recently from 6c5c184 to 7f86264 Compare October 22, 2026 11:41
@tmakatos
tmakatos marked this pull request as ready for review October 22, 2026 11:42
@tmakatos
tmakatos force-pushed the per-vm-log-layer branch 2 times, most recently from 0531b7f to 5d6d55c Compare October 22, 2026 13:20
@tmakatos
tmakatos force-pushed the per-vm-log-layer branch 2 times, most recently from 1e65971 to cded577 Compare October 22, 2026 13:43
@tmakatos
tmakatos force-pushed the per-vm-log-layer branch 3 times, most recently from 8a9ad4d to bd2d421 Compare October 22, 2026 16:45
Comment thread src/per_vm_log.rs
Comment thread src/per_vm_log.rs Outdated
@tmakatos
tmakatos force-pushed the per-vm-log-layer branch 5 times, most recently from 81d36c0 to 7b2a962 Compare October 26, 2026 16:44
Every per-VM event was logged twice, once through tracing and once as
a hand-formatted line for the per-VM file, and events logged elsewhere,
such as the threshold engine's scaling decisions, never reached the
per-VM file at all.

Add a tracing layer that copies every event carrying a vm field to that
VM's file, without the vm field, and log per-VM events only once. Status
and lifecycle records use a dedicated per_vm target that the main log
filters out, so they still only go to the per-VM files. The layer has
its own INFO filter, so RUST_LOG no longer affects the per-VM files.

Use vm consistently for the VM ID field, instead of id or uuid, so that
those events are routed too.

AI-generated: everything
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
Signed-off-by: Thanos Makatos <thanos.makatos@nutanix.com>
@tmakatos
tmakatos removed this pull request from stack #149 October 26, 2026 18:18
@tmakatos
tmakatos added this pull request to stack #167 October 26, 2026 18:19
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