feat(openmetrics): add VDI disk size and physical usage metrics#9680
Open
feat(openmetrics): add VDI disk size and physical usage metrics#9680
Conversation
e40602f to
a69b573
Compare
|
Linked to Plane Work Item(s) This comment was auto-generated by Plane |
6a6c445 to
d0e59bc
Compare
b-Nollet
reviewed
Apr 8, 2026
| #getVdiData(): VdiDataPayload { | ||
| const vdis: VdiDataItem[] = [] | ||
|
|
||
| const allObjects = this.#xo.getObjects() as Record<string, XoObject> |
Collaborator
There was a problem hiding this comment.
Is this necessary to get all the objects?
It would feel more optimal to only get the ones we'll need, which are SRs and VBDs
Collaborator
Author
There was a problem hiding this comment.
Replaced the unfiltered getObjects() with specific filtered queries for SRs and VBDs. The SR lookup now goes through allSrs[vdi.$SR] directly and VBDs through allVbds[vbdId].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add per-VDI disk size metrics to the OpenMetrics/Prometheus endpoint.
Two new gauge metrics are exposed for each VDI:
xcp_vdi_virtual_size_bytesxcp_vdi_physical_usage_bytesLabels:
pool_id,pool_name,sr_uuid,sr_name,vdi_uuid,vdi_name, and optionallyvm_uuid,vm_namewhen the VDI is attached to a VM.The implementation follows the existing SR_METRICS IPC pipeline pattern: data collection in the parent process (
#getVdiData()), IPC transport (GET_VDI_DATA/VDI_DATA), formatting in the child process (formatVdiMetrics()), and integration into the/metricsoutput.Fixes XO-1995
Checklist
Fixes XO-1995)Introduced byCHANGELOG.unreleased.mdReview process
If you are an external contributor, you can skip this part. Simply create the pull request, and we'll get back to you as soon as possible.
Notes: