diff --git a/keystone/common/profiler.py b/keystone/common/profiler.py index 58a515e868..9e59889570 100644 --- a/keystone/common/profiler.py +++ b/keystone/common/profiler.py @@ -11,9 +11,7 @@ # under the License. from oslo_log import log -import oslo_messaging -import osprofiler.notifier -import osprofiler.web +import osprofiler.initializer import keystone.conf from keystone.i18n import _LI @@ -32,11 +30,13 @@ def setup(name, host='0.0.0.0'): # nosec specified host name / address usage is highly recommended. """ if CONF.profiler.enabled: - _notifier = osprofiler.notifier.create( - "Messaging", oslo_messaging, {}, - oslo_messaging.get_transport(CONF), "keystone", name, host) - osprofiler.notifier.set(_notifier) - osprofiler.web.enable(CONF.profiler.hmac_keys) + osprofiler.initializer.init_from_conf( + conf=CONF, + context={}, + project="keystone", + service=name, + host=host + ) LOG.info(_LI("OSProfiler is enabled.\n" "Traces provided from the profiler " "can only be subscribed to using the same HMAC keys that "