Add support for oslo.reports

Oslo Reports enables OpenStack projects to dump Guru Meditation
Reports with useful debugging information on live services
to files or stderr.

Change-Id: I33b6e52870b583c70aa8141ab55d8738beaf5c59
This commit is contained in:
Erik Olof Gunnar Andersson 2019-02-20 10:07:16 -08:00
parent 53fbfc8c63
commit e5435bb7b6
5 changed files with 9 additions and 0 deletions

View File

@ -39,6 +39,7 @@ if os.name == 'nt':
else: else:
eventlet.patcher.monkey_patch() eventlet.patcher.monkey_patch()
from oslo_reports import guru_meditation_report as gmr
from oslo_utils import encodeutils from oslo_utils import encodeutils
# If ../glance/__init__.py exists, add ../ to Python search path, so that # If ../glance/__init__.py exists, add ../ to Python search path, so that
@ -58,6 +59,7 @@ from glance.common import config
from glance.common import exception from glance.common import exception
from glance.common import wsgi from glance.common import wsgi
from glance import notifier from glance import notifier
from glance import version
CONF = cfg.CONF CONF = cfg.CONF
CONF.import_group("profiler", "glance.common.wsgi") CONF.import_group("profiler", "glance.common.wsgi")
@ -86,6 +88,7 @@ def main():
config.set_config_defaults() config.set_config_defaults()
wsgi.set_eventlet_hub() wsgi.set_eventlet_hub()
logging.setup(CONF, 'glance') logging.setup(CONF, 'glance')
gmr.TextGuruMeditation.setup_autorun(version)
notifier.set_defaults() notifier.set_defaults()
if CONF.profiler.enabled: if CONF.profiler.enabled:

View File

@ -39,6 +39,7 @@ if os.name == 'nt':
else: else:
eventlet.patcher.monkey_patch() eventlet.patcher.monkey_patch()
from oslo_reports import guru_meditation_report as gmr
from oslo_utils import encodeutils from oslo_utils import encodeutils
# If ../glance/__init__.py exists, add ../ to Python search path, so that # If ../glance/__init__.py exists, add ../ to Python search path, so that
@ -56,6 +57,7 @@ import osprofiler.initializer
from glance.common import config from glance.common import config
from glance.common import wsgi from glance.common import wsgi
from glance import notifier from glance import notifier
from glance import version
CONF = cfg.CONF CONF = cfg.CONF
CONF.import_group("profiler", "glance.common.wsgi") CONF.import_group("profiler", "glance.common.wsgi")
@ -69,6 +71,7 @@ def main():
config.set_config_defaults() config.set_config_defaults()
wsgi.set_eventlet_hub() wsgi.set_eventlet_hub()
logging.setup(CONF, 'glance') logging.setup(CONF, 'glance')
gmr.TextGuruMeditation.setup_autorun(version)
notifier.set_defaults() notifier.set_defaults()
if CONF.profiler.enabled: if CONF.profiler.enabled:

View File

@ -16,3 +16,4 @@
import pbr.version import pbr.version
version_info = pbr.version.VersionInfo('glance') version_info = pbr.version.VersionInfo('glance')
version_string = version_info.version_string

View File

@ -72,6 +72,7 @@ oslo.log==3.36.0
oslo.messaging==5.29.0 oslo.messaging==5.29.0
oslo.middleware==3.31.0 oslo.middleware==3.31.0
oslo.policy==1.30.0 oslo.policy==1.30.0
oslo.reports==1.18.0
oslo.serialization==2.25.0 oslo.serialization==2.25.0
oslo.service==1.30.0 oslo.service==1.30.0
oslo.upgradecheck==0.1.0 oslo.upgradecheck==0.1.0

View File

@ -41,6 +41,7 @@ oslo.i18n>=3.15.3 # Apache-2.0
oslo.log>=3.36.0 # Apache-2.0 oslo.log>=3.36.0 # Apache-2.0
oslo.messaging>=5.29.0,!=9.0.0 # Apache-2.0 oslo.messaging>=5.29.0,!=9.0.0 # Apache-2.0
oslo.middleware>=3.31.0 # Apache-2.0 oslo.middleware>=3.31.0 # Apache-2.0
oslo.reports>=1.18.0 # Apache-2.0
oslo.policy>=1.30.0 # Apache-2.0 oslo.policy>=1.30.0 # Apache-2.0
retrying!=1.3.0,>=1.2.3 # Apache-2.0 retrying!=1.3.0,>=1.2.3 # Apache-2.0