You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[nutanix] Normalize ntnx_* tags to lowercase with $unknown fallback (DataDog#23609)
* fix(nutanix): normalize all ntnx_* tags to lowercase with $unknown fallback
Route every enum-backed ntnx_* tag (host_type, hypervisor_type,
node_status, plus the previously-handled state tags) through a single
_norm_state helper so they all follow one rule: lowercase the API
value, fall back to "\$unknown" when the source is missing.
Picks "\$unknown" (the API spec's own sentinel) as the fallback so
there's no mismatch between "value present but says \$UNKNOWN" and
"value missing" — both surface as ntnx_X:\$unknown.
ntnx_disk_status's "unknown" fallback is updated to "\$unknown" for
the same reason.
* docs(nutanix): add changelog for tag normalization
* docs(nutanix): shorten changelog to one customer-facing line
* refactor(nutanix): extract tag values into named variables
Hoist _norm_state and get_nested calls out of f-strings in the
tag-extraction helpers. Each tag computation now binds to a named
local first, making the read top-down and easier to step through.
* refactor(nutanix): rename _norm_state to _normalize_tag_value
The helper is used for type, state, mode, and status tags — not just
state — so the broader name better describes what it does.
* refactor(nutanix): collapse node_status to one variable, restore tags = []
Lowercase the node-status comparison sets so the normalized tag value
serves both the status_value lookup and the tag emission, removing the
need for a separate node_status_tag local.
Restore the tags = [] preamble in the tag-extraction helpers since it
makes the building intent obvious.
* fix(nutanix): normalize powerState in vm.status gauge
Match what _report_host_status_metrics does: route the powerState
lookup through _normalize_tag_value and lowercase the comparison
literals. Removes the asymmetry where vm.status was the only metric
still relying on raw uppercase API values.
Addresses review feedback on PR DataDog#23609.
* refactor(nutanix): normalize disk statuses in _aggregate_disk_status
Lowercase DEGRADED_DISK_STATUSES at the constant and route disk
``status`` values through ``_normalize_tag_value`` so the comparison
surface matches the rest of the module. Aligns with the convention
introduced in ``_report_host_status_metrics``.
* test(nutanix): cover \$unknown fallback for host enum tags
Verify ``ntnx_host_type``, ``ntnx_hypervisor_type``, and
``ntnx_node_status`` emit ``\$unknown`` when ``hostType``,
``hypervisor.type``, and ``nodeStatus`` are absent from the host
payload, the always-emit behavior introduced in this PR.
* test(nutanix): align unknown-fallback test with repo conventions
0 commit comments