Support new osprofiler API

Notifier initialization moved to osprofiler. Added call
to init_from_conf method that does it.

Change-Id: I7cba52f9a6c8f4b8a9714382169cee15fb38a58a
Depends-On: I77d0d3b5e9e725507916724dcd28d5fbc6f7f5c7
This commit is contained in:
Alexander Ignatyev 2016-07-13 12:53:46 +03:00
parent 45369b608a
commit 51cccd24dd

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