Skip to content

Add vcenter.vm.power_state as a resource attribute on per-VM metrics #47776

@snowch

Description

@snowch

Component(s)

receiver/vcenter

Is your feature request related to a problem? Please describe.

The vCenter receiver currently tracks VM power state (vm.Runtime.PowerState) internally for aggregate count metrics (vcenter.cluster.vm.count, vcenter.datacenter.vm.count) but does not expose it as a resource attribute on per-VM metrics.

Powered-off and suspended VMs still emit some metrics (disk usage, memory) but not others (CPU). Downstream consumers (observability platforms, alerting systems) cannot distinguish a powered-off VM from a failed VM without the power state — both appear as "partially reporting" entities.

Describe the solution you'd like

Proposed change:

Add vcenter.vm.power_state as a resource attribute (type: string, values: poweredOn, poweredOff, suspended) on all per-VM metrics. The data is already fetched via runtime.powerState in client.go — it just needs to be surfaced as a resource attribute in createVMResourceBuilder().

Use case:

Observability platforms use staleness detection to alert when entities stop reporting metrics. Without per-VM power state, powered-off VMs (which legitimately have no CPU metrics) trigger false "service down" alerts. At scale (6,000+ VMs), this produces thousands of false positives that obscure real outages.

With vcenter.vm.power_state as a resource attribute, downstream systems can filter poweredOff entities from staleness detection.

Impact: 3 generated files + 1 line in resources.go. No breaking changes — the attribute is enabled by default but can be disabled via config.

vcenter-vm-power-state.patch

Describe alternatives you've considered

No response

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions