Merge "Support new osprofiler API"

This commit is contained in:
Jenkins 2016-08-25 20:30:09 +00:00 committed by Gerrit Code Review
commit 359275891c

@ -11,9 +11,7 @@
# under the License. # under the License.
from oslo_log import log from oslo_log import log
import oslo_messaging import osprofiler.initializer
import osprofiler.notifier
import osprofiler.web
import keystone.conf import keystone.conf
from keystone.i18n import _LI 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. specified host name / address usage is highly recommended.
""" """
if CONF.profiler.enabled: if CONF.profiler.enabled:
_notifier = osprofiler.notifier.create( osprofiler.initializer.init_from_conf(
"Messaging", oslo_messaging, {}, conf=CONF,
oslo_messaging.get_transport(CONF), "keystone", name, host) context={},
osprofiler.notifier.set(_notifier) project="keystone",
osprofiler.web.enable(CONF.profiler.hmac_keys) service=name,
host=host
)
LOG.info(_LI("OSProfiler is enabled.\n" LOG.info(_LI("OSProfiler is enabled.\n"
"Traces provided from the profiler " "Traces provided from the profiler "
"can only be subscribed to using the same HMAC keys that " "can only be subscribed to using the same HMAC keys that "