Ceilometer apply server_group to resource slowly

Bug #1903943 reported by Corey Chen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
New
Undecided
Unassigned

Bug Description

I add the metadata "metering.server_group":"corey-group" to an instance while creating, and check it by using "nova show", it is applied, then I check the Gnocchi resource using "gnocchi resource show --type instance ${instance-id}", the attribute server_group is None in the begining, but after a while, it will be applied (always on the hour, ex: 07:00, 08:00...), I have no idea what happens, I think this issue will cause Gnocchi gets incorrect datasets while doing aggregation.

I added some log in the file ceilometer/publisher/gnocchi.py, and found that it updates resource every minutes, but the variable "resource_extra" gets "server_group" only on the hour, that's why it is None is the begining.

Here are some parts of the logs:
2020-11-09 **11:59:15** DEBUG ceilometer.publisher.gnocchi Resource {'host': u'test-com-002', 'display_name': u'vm-001', 'flavor_id': u'xxx', 'flavor_name': u'xxx'} publish_samples /usr/lib/python2.7/site-packages/ceilometer/publisher/gnocchi.py:345

2020-11-09 **12:00:15** DEBUG ceilometer.publisher.gnocchi Resource {'host': u'test-com-002', 'display_name': u'vm-001', 'flavor_name': u'xxx', **'server_group': 'corey-group'**} publish_samples /usr/lib/python2.7/site-packages/ceilometer/publisher/gnocchi.py:345

2020-11-09 **12:01:15** DEBUG ceilometer.publisher.gnocchi Resource {'host': u'test-com-002', 'display_name': u'vm-001', 'flavor_id': u'xxx', 'flavor_name': u'xxx'} publish_samples /usr/lib/python2.7/site-packages/ceilometer/publisher/gnocchi.py:345

Env:
Running on Queens, and I can't reproduce this issue on Pike.

Tags: ceilometer
Corey Chen (coreychen)
tags: added: openstack-ceilometer
tags: added: ceilometer
removed: openstack-ceilometer
affects: ceilometer-dashboard → openstack-ci
Revision history for this message
Corey Chen (coreychen) wrote :

Seems like is the same issue to [this](https://bugs.launchpad.net/charm-ceilometer-agent/+bug/1749954)

I explicitly defind the instance_discovery_method as "naive" solved the problem.

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.