Skip to content

[nutanix] Warn and skip entities missing extId or name#23612

Open
NouemanKHAL wants to merge 5 commits intonoueman/nutanix-normalize-tagsfrom
noueman/nutanix-skip-incomplete-entities
Open

[nutanix] Warn and skip entities missing extId or name#23612
NouemanKHAL wants to merge 5 commits intonoueman/nutanix-normalize-tagsfrom
noueman/nutanix-skip-incomplete-entities

Conversation

@NouemanKHAL
Copy link
Copy Markdown
Member

@NouemanKHAL NouemanKHAL commented May 6, 2026

What

Stacked on #23609.

Log a warning and skip entities whose API response is missing fields the integration can't function without:

Entity Required fields Reason
Cluster extId, name extId is needed for downstream host/VM API calls. name is cached for cross-entity ntnx_cluster_name tagging.
Host extId, hostName extId is needed for the host stats API call. hostName is the metric hostname= used for DD correlation.
VM extId, name extId looks up VM stats. name is the metric hostname= 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.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment on lines +415 to +417
if not host_name:
self.check.log.warning("[%s][%s] Host %s has no hostName, skipping", self._pc_label, cluster_name, host_id)
return
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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
Copy link
Copy Markdown

codecov Bot commented May 6, 2026

Codecov Report

❌ Patch coverage is 59.37500% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 89.04%. Comparing base (1a5a0ae) to head (f3f1e6c).

Additional details and impacted files
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@datadog-prod-us1-4
Copy link
Copy Markdown
Contributor

datadog-prod-us1-4 Bot commented May 6, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 59.38%
Overall Coverage: 90.15% (-0.32%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f3f1e6c | Docs | Datadog PR Page | Give us feedback!

@NouemanKHAL NouemanKHAL force-pushed the noueman/nutanix-normalize-tags branch from 01a7351 to cb41e10 Compare May 6, 2026 12:22
@NouemanKHAL NouemanKHAL requested a review from a team as a code owner May 6, 2026 12:22
@NouemanKHAL NouemanKHAL force-pushed the noueman/nutanix-skip-incomplete-entities branch from 68ab3e8 to 8bc5446 Compare May 6, 2026 12:23
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.
@NouemanKHAL NouemanKHAL force-pushed the noueman/nutanix-skip-incomplete-entities branch from 8bc5446 to f3f1e6c Compare May 7, 2026 21:22
@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 7, 2026

Validation Report

All 20 validations passed.

Show details
Validation Description Status
agent-reqs Verify check versions match the Agent requirements file
ci Validate CI configuration and Codecov settings
codeowners Validate every integration has a CODEOWNERS entry
config Validate default configuration files against spec.yaml
dep Verify dependency pins are consistent and Agent-compatible
http Validate integrations use the HTTP wrapper correctly
imports Validate check imports do not use deprecated modules
integration-style Validate check code style conventions
jmx-metrics Validate JMX metrics definition files and config
labeler Validate PR labeler config matches integration directories
legacy-signature Validate no integration uses the legacy Agent check signature
license-headers Validate Python files have proper license headers
licenses Validate third-party license attribution list
metadata Validate metadata.csv metric definitions
models Validate configuration data models match spec.yaml
openmetrics Validate OpenMetrics integrations disable the metric limit
package Validate Python package metadata and naming
readmes Validate README files have required sections
saved-views Validate saved view JSON file structure and fields
version Validate version consistency between package and changelog

View full run

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants