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

View File

@ -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 "