Merge "Support new osprofiler API"
This commit is contained in:
commit
54429130a1
|
@ -13,13 +13,10 @@
|
||||||
|
|
||||||
from oslo_config import cfg
|
from oslo_config import cfg
|
||||||
from oslo_log import log as logging
|
from oslo_log import log as logging
|
||||||
import oslo_messaging as messaging
|
import osprofiler.initializer
|
||||||
import osprofiler.profiler
|
|
||||||
import osprofiler.web
|
|
||||||
|
|
||||||
from heat.common import context
|
from heat.common import context
|
||||||
from heat.common.i18n import _LW
|
from heat.common.i18n import _LW
|
||||||
from heat.common import messaging as rpc_messaging
|
|
||||||
|
|
||||||
cfg.CONF.import_opt('enabled', 'heat.common.config', group='profiler')
|
cfg.CONF.import_opt('enabled', 'heat.common.config', group='profiler')
|
||||||
|
|
||||||
|
@ -28,11 +25,12 @@ LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
def setup(binary, host):
|
def setup(binary, host):
|
||||||
if cfg.CONF.profiler.enabled:
|
if cfg.CONF.profiler.enabled:
|
||||||
_notifier = osprofiler.notifier.create(
|
osprofiler.initializer.init_from_conf(
|
||||||
"Messaging", messaging, context.get_admin_context().to_dict(),
|
conf=cfg.CONF,
|
||||||
rpc_messaging.TRANSPORT, "heat", binary, host)
|
context=context.get_admin_context().to_dict(),
|
||||||
osprofiler.notifier.set(_notifier)
|
project="heat",
|
||||||
osprofiler.web.enable(cfg.CONF.profiler.hmac_keys)
|
service=binary,
|
||||||
|
host=host)
|
||||||
LOG.warning(_LW("OSProfiler is enabled.\nIt means that person who "
|
LOG.warning(_LW("OSProfiler is enabled.\nIt means that person who "
|
||||||
"knows any of hmac_keys that are specified in "
|
"knows any of hmac_keys that are specified in "
|
||||||
"/etc/heat/heat.conf can trace his requests. \n"
|
"/etc/heat/heat.conf can trace his requests. \n"
|
||||||
|
|
Loading…
Reference in New Issue