Skip to content

Commit

Permalink
Use OSprofiler options consolidated in lib itself
Browse files Browse the repository at this point in the history
Starting with 1.0.0 osprofiler release options needed for
its workability are consolidated inside osprofiler itself.
Let's use them.

Change-Id: Ib0266e0a6e9bfa99c4bacbdca623ab1211a822eb
  • Loading branch information
DinaBelova committed May 25, 2016
1 parent 24fae90 commit 790b015
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 14 deletions.
1 change: 1 addition & 0 deletions etc/oslo-config-generator/glance-api.conf
Expand Up @@ -10,3 +10,4 @@ namespace = oslo.policy
namespace = keystonemiddleware.auth_token
namespace = oslo.log
namespace = oslo.middleware.cors
namespace = osprofiler
1 change: 1 addition & 0 deletions etc/oslo-config-generator/glance-glare.conf
Expand Up @@ -7,3 +7,4 @@ namespace = oslo.db.concurrency
namespace = keystonemiddleware.auth_token
namespace = oslo.log
namespace = oslo.middleware.cors
namespace = osprofiler
1 change: 1 addition & 0 deletions etc/oslo-config-generator/glance-registry.conf
Expand Up @@ -8,3 +8,4 @@ namespace = oslo.db.concurrency
namespace = oslo.policy
namespace = keystonemiddleware.auth_token
namespace = oslo.log
namespace = osprofiler
13 changes: 2 additions & 11 deletions glance/common/wsgi.py
Expand Up @@ -40,6 +40,7 @@
from oslo_serialization import jsonutils
from oslo_utils import encodeutils
from oslo_utils import strutils
from osprofiler import opts as profiler_opts
import routes
import routes.middleware
import six
Expand Down Expand Up @@ -112,16 +113,6 @@
'"HTTP_X_FORWARDED_PROTO".')),
]

profiler_opts = [
cfg.BoolOpt('enabled', default=False,
help=_('If False fully disable profiling feature.')),
cfg.BoolOpt('trace_sqlalchemy', default=False,
help=_("If False doesn't trace SQL requests.")),
cfg.StrOpt('hmac_keys', default="SECRET_KEY",
help=_("Secret key to use to sign Glance API and Glance "
"Registry services tracing messages.")),
]


LOG = logging.getLogger(__name__)

Expand All @@ -130,7 +121,7 @@
CONF.register_opts(socket_opts)
CONF.register_opts(eventlet_opts)
CONF.register_opts(wsgi_opts)
CONF.register_opts(profiler_opts, group="profiler")
profiler_opts.set_defaults(CONF)

ASYNC_EVENTLET_THREAD_POOL_LIST = []

Expand Down
8 changes: 5 additions & 3 deletions glance/opts.py
Expand Up @@ -24,6 +24,8 @@
import copy
import itertools

from osprofiler import opts as profiler

import glance.api.middleware.context
import glance.api.versions
import glance.async.taskflow_executor
Expand Down Expand Up @@ -68,7 +70,7 @@
glance.async.taskflow_executor.taskflow_executor_opts),
('store_type_location_strategy',
glance.common.location_strategy.store_type.store_type_opts),
('profiler', glance.common.wsgi.profiler_opts),
profiler.list_opts()[0],
('paste_deploy', glance.common.config.paste_deploy_opts)
]
_registry_opts = [
Expand All @@ -79,7 +81,7 @@
glance.common.wsgi.socket_opts,
glance.common.wsgi.wsgi_opts,
glance.common.wsgi.eventlet_opts))),
('profiler', glance.common.wsgi.profiler_opts),
profiler.list_opts()[0],
('paste_deploy', glance.common.config.paste_deploy_opts)
]
_scrubber_opts = [
Expand Down Expand Up @@ -110,7 +112,7 @@
glance.common.wsgi.bind_opts,
glance.common.wsgi.eventlet_opts,
glance.common.wsgi.socket_opts,
glance.common.wsgi.profiler_opts,
profiler.list_opts()[0],
glance.notifier.notifier_opts))),
('paste_deploy', glance.common.config.paste_deploy_opts)
]
Expand Down

0 comments on commit 790b015

Please sign in to comment.