oslo.reports/doc/source/user/usage.rst
ChangBo Guo(gcb) 5ce4e61f18 rearrange content to fit the new standard layout
Depends-On: Ia750cb049c0f53a234ea70ce1f2bbbb7a2aa9454

Change-Id: Ic8d93ffc98b347e4158c715b88d15372b0948887
2017-06-29 19:17:17 +08:00

1.2 KiB

Usage

Every long running service process should have a call to install a signal handler which will trigger the guru meditation framework upon receipt of SIGUSR1/SIGUSR2. This will result in the process dumping a complete report of its current state to stderr.

For RPC listeners, it may also be desirable to install some kind of hook in the RPC request dispatcher that will save a guru meditation report whenever the processing of a request results in an uncaught exception. It could save these reports to a well known directory (/var/log/openstack/<project>/<service>/) for later analysis by the sysadmin or automated bug analysis tools.

To use oslo.reports in a project, you need to add the following call to :py~oslo_reports.TextGuruMeditation.setup_autorun somewhere really early in the startup sequence of the process:

from oslo_reports import guru_meditation_report as gmr

gmr.TextGuruMeditation.setup_autorun(version='13.0.0')

Note that the version parameter is the version of the component itself.

To trigger the report to be generated:

kill -SIGUSR2 <process_id>

Here is a sample report: