[nutanix] Warn and skip entities missing extId or name#23612
[nutanix] Warn and skip entities missing extId or name#23612NouemanKHAL wants to merge 5 commits intonoueman/nutanix-normalize-tagsfrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64930b9c3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not host_name: | ||
| self.check.log.warning("[%s][%s] Host %s has no hostName, skipping", self._pc_label, cluster_name, host_id) | ||
| return |
There was a problem hiding this comment.
Do not skip VMs when their host lacks hostName
When a host has an extId but the API omits hostName, this early return skips the rest of _process_single_host, including the later _get_vms_for_host(host_id) loop. Those VMs can still have valid extId/name and were previously collected; after this change all VM metrics for VMs on that unnamed host are dropped, and in non-batch mode their allocated capacity is also omitted because the VM cache is never populated for that host. Consider skipping only host metric emission while still fetching/processing the host's VMs.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is Additional details and impacted files🚀 New features to boost your workflow:
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: f3f1e6c | Docs | Datadog PR Page | Give us feedback! |
01a7351 to
cb41e10
Compare
68ab3e8 to
8bc5446
Compare
Hosts now warn-and-skip when hostName is missing (previously they emitted metrics with hostname=None, useless for correlation), VMs upgrade their existing missing-id/name skip from debug to warning, and clusters now warn-and-skip when name is missing (previously they were processed with no ntnx_cluster_name tag and weren't cached for VM/host cluster-name tagging).
The variable was named after how it's consumed downstream (the hostname= kwarg to gauge calls), not what it actually is — the VM's "name" field from the API. Rename to vm_name for symmetry with host_name on the host side; the gauge call still passes it as hostname=vm_name.
8bc5446 to
f3f1e6c
Compare
Validation ReportAll 20 validations passed. Show details
|
What
Stacked on #23609.
Log a warning and skip entities whose API response is missing fields the integration can't function without:
extId,nameextIdis needed for downstream host/VM API calls.nameis cached for cross-entityntnx_cluster_nametagging.extId,hostNameextIdis needed for the host stats API call.hostNameis the metrichostname=used for DD correlation.extId,nameextIdlooks up VM stats.nameis the metrichostname=used for DD correlation.Note: per the v4.0 specs none of these fields are marked
required, but the integration cannot emit usable metrics without them.Validate
Unit tests.