KeyError: 'counter_unit'. Fail to record metering data.

Bug #1207486 reported by Alexander Sheredin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Invalid
Undecided
Chmouel Boudjnah

Bug Description

When swift middleware from ceilometer-2013.1 publishes counters storage.objects.outgoing.bytes and storage.objects.incoming.bytes, the exception occurs in the collector (the latest grizzly):

2013-08-01 08:31:35 ERROR [ceilometer.collector.service] 'counter_unit'
Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/ceilometer-2013.1.3.a1.g315daa7-py2.6.egg/ceilometer/collector/service.py", line 147, in record_metering_data
    self.storage_conn.record_metering_data(meter)
  File "/usr/lib/python2.6/site-packages/ceilometer-2013.1.3.a1.g315daa7-py2.6.egg/ceilometer/storage/impl_mongodb.py", line 334, in record_metering_data
    'counter_unit': data['counter_unit'],
KeyError: 'counter_unit'

The patch is attached that would resolve this issue.

Tags: swift
Revision history for this message
Alexander Sheredin (alexander-sheredin) wrote :
Changed in ceilometer:
assignee: nobody → Chmouel Boudjnah (chmouel)
Revision history for this message
Chmouel Boudjnah (chmouel) wrote :

This actually should not happen :

08:31 sileht: chmouel, in grizzly a counter is a namedtuple you can't create it without counter_unit

Changed in ceilometer:
status: New → Invalid
Revision history for this message
Alexander Sheredin (alexander-sheredin) wrote :

> in grizzly a counter is a namedtuple you can't create it without counter_unit

it is possible in early grizzly release ceilometer 2013.1-4 . It was changed here:
https://github.com/openstack/ceilometer/commit/c0379cefd94d0a769be436bf2ffe5938925e5c5a#ceilometer/objectstore/swift_middleware.py

In my configuration swift_middleware is installed with yum install (grizzly 2013.1-4) and units are not reported. On the other hand, ceilometer collector is installed (on the other host) from the latest source from grizzly branch. So, it cannot process the counters published by early grizzly version of swift middleware.

There was a similar bug in the past on the similar issue with the similar solution in the same module:
https://bugs.launchpad.net/ceilometer/+bug/1098603

If a configuration with different versions of swift middleware and ceilometer collector is not supported, then this is not a bug.

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.