Git Product home page Git Product logo

Comments (5)

adamoswick avatar adamoswick commented on July 30, 2024 3

This seems to be a result of changes in the Nova API after version 2.87. The gophercloud code tries to fetch the cpu_info output from the os-hypervisor/detail API route. However, this doesn't exist anymore so the type is None causing an error from the SDK.

This causes the SDK to error and ultimately the Nova collector in openstack-exporter also errors meaning the metrics here fail. We've worked around this by setting prometheus_openstack_exporter_compute_api_version = 2.87 in Kolla Ansible (which sets OS_COMPUTE_API_VERSION=2.87 in the environment for openstack-exporter).

The 2.87 version of the Nova API still contains the cpu_info output meaning the error doesn't get thrown. Ideally, the Nova API changes following 2.87 need to be supported by the gophercloud SDK.

from openstack-exporter.

srkaviani avatar srkaviani commented on July 30, 2024

I have this problem too. (msg="Failed to collect metric for exporter: nova, error: failed to collect metric: running_vms, error: CPUInfo has unexpected type: " source="exporter.go:123") after update to wallaby.

from openstack-exporter.

Oxyash avatar Oxyash commented on July 30, 2024

same problem on Zed
level=error msg="Failed to collect metric for exporter: nova, error: failed to collect metric: running_vms, error: CPUInfo has unexpected type: " source="exporter .go:123"

from openstack-exporter.

srkaviani avatar srkaviani commented on July 30, 2024

@adamoswick
Thanks. This was very helpful.

from openstack-exporter.

samuelallan72 avatar samuelallan72 commented on July 30, 2024

On latest main I get this similar error output:

ts=2024-04-03T23:09:00.715Z caller=exporter.go:126 level=error err="Failed to collect metric for exporter" exporter=nova error="failed to collect metric: running_vms, error: CPUInfo has unexpected type: <nil>"

Confirming that setting OS_COMPUTE_API_VERSION=2.87 in the environment fixes the issue.


Also note that when this error happens, it also causes metrics to not be written for all the other metrics in the ListHypervisors function:

ch <- prometheus.MustNewConstMetric(exporter.Metrics["running_vms"].Metric,
prometheus.GaugeValue, float64(hypervisor.RunningVMs), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["current_workload"].Metric,
prometheus.GaugeValue, float64(hypervisor.CurrentWorkload), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["vcpus_available"].Metric,
prometheus.GaugeValue, float64(hypervisor.VCPUs), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["vcpus_used"].Metric,
prometheus.GaugeValue, float64(hypervisor.VCPUsUsed), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["memory_available_bytes"].Metric,
prometheus.GaugeValue, float64(hypervisor.MemoryMB*MEGABYTE), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["memory_used_bytes"].Metric,
prometheus.GaugeValue, float64(hypervisor.MemoryMBUsed*MEGABYTE), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["local_storage_available_bytes"].Metric,
prometheus.GaugeValue, float64(hypervisor.LocalGB*GIGABYTE), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["local_storage_used_bytes"].Metric,
prometheus.GaugeValue, float64(hypervisor.LocalGBUsed*GIGABYTE), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))
ch <- prometheus.MustNewConstMetric(exporter.Metrics["free_disk_bytes"].Metric,
prometheus.GaugeValue, float64(hypervisor.FreeDiskGB*GIGABYTE), hypervisor.HypervisorHostname, availabilityZone, aggregatesLabel(hypervisor.Service.Host, hostToAggrMap))

from openstack-exporter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.