Ask Your Question
0

Debugging in Ceilometer

asked 2019-01-22 01:07:52 -0500

pm gravatar image

I am working on a bug in ceilometer and wanted to learn the functionality of the code in file gnocchi.py (ceilometer/publisher/gnocchi.py). Let me first tell what bug I am working on.

When we create an instance in nova using command "openstack server create", ceilometer/gnocchi creates a metric named "cpu" corresponding to the instance id. While deleting the instance using command "openstack server delete", the metric that was created corresponding that insatnce still remains.

To understand how does ceilometer/gnocchi creates this metric, I used command "sudo journalctl -f --unit devstack@ceilometer-a*" to check logs and then created a new instance.

I got following logs,

Jan 22 06:50:13 ubuntu-bionic ceilometer-agent-notification[28894]: 2019-01-22 06:50:13.657 29022 DEBUG ceilometer.publisher.gnocchi [-] No gnocchi definition for event type: scheduler.select_destinations.end publish_events /opt/stack/ceilometer/ceilometer/publisher/gnocchi.py:489 Jan 22 06:50:13 ubuntu-bionic ceilometer-agent-notification[28894]: 2019-01-22 06:50:13.687 29022 DEBUG oslo_db.sqlalchemy.engines [-] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _check_effective_sql_mode /usr/local/lib/python2.7/dist-packages/oslo_db/sqlalchemy/engines.py:307

I inserted ,

def _create_resource(self, resource_type, resource):
    import pdb;pdb.set_trace()
    self._gnocchi.resource.create(resource_type, resource)
    LOG.debug('Resource %s created', resource["id"])

Ceilometer has 3 services , devstack@ceilometer-acentral.service devstack@ceilometer-acompute.service devstack@ceilometer-anotification.ser...

Then ran each service individually and got error in ceilometer-anotification.service relating to pdb.

Can someone suggest how do I debug the code using pdb or some other way.

Thanks

edit retag flag offensive close merge delete

Comments

1

While deleting the instance using command "openstack server delete", the metric that was created corresponding that insatnce still remains.

This is not a bug. You want to keep the data even after the resource has been deleted. Historical data has its uses; think of billing.

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-22 02:13:09 -0500 )edit

Ohh . Got your point. Thank you.

Just in case I want to debug using pdb (for genral purpose), how can it be done?

pm gravatar imagepm ( 2019-01-22 02:43:01 -0500 )edit

Sorry, I can't answer this question. This is why I only posted a comment.

Bernd Bausch gravatar imageBernd Bausch ( 2019-01-22 04:02:03 -0500 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2019-02-01 20:00:04 -0500

Shaoman Zhang gravatar image

If your ceilometer uses cotyledon to start the application framework, then you can not directly use the pdb. Try this:

https://blog.csdn.net/mengalong/artic...

edit flag offensive delete link more

Comments

That helped. Thankyou :)

pm gravatar imagepm ( 2019-02-03 23:47:16 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2019-01-22 01:07:52 -0500

Seen: 72 times

Last updated: Feb 01