From e3def058ca47f05fdadc04659ac5607749947ceb Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 13 Oct 2024 12:14:03 +0900 Subject: [PATCH] Support file watcher to trigger GMR report Allow generating GMR report upon file trigger in addition to a signal. The feature has been available in oslo.reports since 1.11.0[1] but it can't be used in heat without proper initialization. [1] d23e0a65b23dc77d0104075d2313de6ca22b5cae Change-Id: I28621f85348b47534b08a8652cd7cce348942428 --- heat/cmd/api.py | 4 +++- heat/cmd/api_cfn.py | 4 +++- heat/cmd/engine.py | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/heat/cmd/api.py b/heat/cmd/api.py index b8ea0111cf..ded2b411dc 100644 --- a/heat/cmd/api.py +++ b/heat/cmd/api.py @@ -27,6 +27,7 @@ from oslo_config import cfg import oslo_i18n as i18n from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from oslo_service import systemd from heat.common import config @@ -59,7 +60,8 @@ def launch_api(setup_logging=True): LOG.info('Starting Heat REST API on %(host)s:%(port)s', {'host': host, 'port': port}) profiler.setup(CONF.prog, host) - gmr.TextGuruMeditation.setup_autorun(version) + gmr_opts.set_defaults(CONF) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) server = wsgi.Server(CONF.prog, CONF.heat_api) server.start(app, default_port=port) return server diff --git a/heat/cmd/api_cfn.py b/heat/cmd/api_cfn.py index bc7cd5b022..bb759131ef 100644 --- a/heat/cmd/api_cfn.py +++ b/heat/cmd/api_cfn.py @@ -29,6 +29,7 @@ from oslo_config import cfg import oslo_i18n as i18n from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from oslo_service import systemd from heat.common import config @@ -63,7 +64,8 @@ def launch_cfn_api(setup_logging=True): LOG.info('Starting Heat API on %(host)s:%(port)s', {'host': host, 'port': port}) profiler.setup(CONF.prog, host) - gmr.TextGuruMeditation.setup_autorun(version) + gmr_opts.set_defaults(CONF) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) server = wsgi.Server(CONF.prog, CONF.heat_api_cfn) server.start(app, default_port=port) return server diff --git a/heat/cmd/engine.py b/heat/cmd/engine.py index f30081d7e7..9fa9c53cc2 100644 --- a/heat/cmd/engine.py +++ b/heat/cmd/engine.py @@ -30,6 +30,7 @@ from oslo_config import cfg import oslo_i18n as i18n from oslo_log import log as logging from oslo_reports import guru_meditation_report as gmr +from oslo_reports import opts as gmr_opts from oslo_service import service from heat.common import config @@ -69,7 +70,8 @@ def launch_engine(setup_logging=True): from heat.engine import service as engine # noqa profiler.setup(CONF.prog, CONF.host) - gmr.TextGuruMeditation.setup_autorun(version) + gmr_opts.set_defaults(CONF) + gmr.TextGuruMeditation.setup_autorun(version, conf=CONF) srv = engine.EngineService(CONF.host, rpc_api.ENGINE_TOPIC) workers = CONF.num_engine_workers if not workers: