inspect_memory_resident throws error log messages if inspector does not have implemented

Bug #1480309 reported by Drew Thorstensen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Drew Thorstensen

Bug Description

The pollster for the memory.py was added a few months back. It will throw an error if the given inspector does not have the method implemented like so:

2015-07-31 08:38:30.284 31158 ERROR ceilometer.compute.pollsters.memory [-] Could not get Resident Memory Usage for dcf8d84c-dbbc-473d-9ef4-c3509961e90f: 'PowerVMInspector' object has no attribute 'inspect_memory_resident'
2015-07-31 08:38:30.284 31158 ERROR ceilometer.compute.pollsters.memory Traceback (most recent call last):
2015-07-31 08:38:30.284 31158 ERROR ceilometer.compute.pollsters.memory File "/opt/stack/ceilometer/ceilometer/compute/pollsters/memory.py", line 78, in get_samples
2015-07-31 08:38:30.284 31158 ERROR ceilometer.compute.pollsters.memory memory_info = self.inspector.inspect_memory_resident(
2015-07-31 08:38:30.284 31158 ERROR ceilometer.compute.pollsters.memory AttributeError: 'PowerVMInspector' object has no attribute 'inspect_memory_resident'
2015-07-31 08:38:30.284 31158 ERROR ceilometer.compute.pollsters.memory

This does not follow the same logging scheme as other pollsters and will quickly fill up the logs of inspectors that have not implemented this sample type.

This issue occurs because the 'inspect_memory_resident' was not defined in the base inspector (ceilometer/compute/virt/inspector.py).

Changed in ceilometer:
assignee: nobody → Drew Thorstensen (thorst)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/207907

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/207907
Committed: https://git.openstack.org/cgit/openstack/ceilometer/commit/?id=778b1b080f2ad525a056c8de7ef51a684522fdd3
Submitter: Jenkins
Branch: master

commit 778b1b080f2ad525a056c8de7ef51a684522fdd3
Author: Drew Thorstensen <email address hidden>
Date: Fri Jul 31 09:43:30 2015 -0400

    Provide base method for inspect_memory_resident

    The inspect_memory_resident was introduced a few months back. When a
    new inspector element is added, it should also be added to the base
    inspector. The base inspector should raise a NotImplementedError.

    Due to this missing defintion, the pollster for the resident memory was
    throwing an error for every instance that was sampled - if that
    inspector did not have this method defined.

    This change set adds a base definition, which removes the excessive
    logging per instance when using a non-libvirt inspector.

    Change-Id: Ibac8a18a3e84fb90763c48c892583d8d3785c91c
    Closes-Bug: 1480309

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → liberty-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: liberty-3 → 5.0.0
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.